Skip to content

Commit

Permalink
Merge pull request #65 from timabell/ci-working-directory-refactor
Browse files Browse the repository at this point in the history
ci: Refactor - Use `working-directory`
  • Loading branch information
timabell authored Jan 30, 2024
2 parents 669a5c2 + 90bd970 commit f34069e
Showing 1 changed file with 18 additions and 36 deletions.
54 changes: 18 additions & 36 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,43 +64,38 @@ jobs:
- name: Install dependencies
run: go get .

- name: Setup - sqlite
working-directory: sqlite
run: ./setup.sh

- name: Test - sqlite flags
run: |
pushd .
cd sqlite
./setup.sh
file="`pwd`/db/test.db" # relative path hack with pwd, otherwise not resolved.
popd
go clean -testcache
go test -v sse_test.go \
--driver=sqlite \
--display-name=testing-flags \
--live=true \
--listen-on-port=9999 \
--sqlite-file="$file" \
2>&1 | go-junit-report -iocopy -set-exit-code -out results-sqlite-flags-${{ matrix.go-version }}.xml
--sqlite-file="`pwd`/sqlite/db/test.db" \
2>&1 | go-junit-report -iocopy -set-exit-code -out results-sqlite-flags-${{ matrix.go-version }}.xml
- name: Setup - sqlite (2)
working-directory: sqlite
run: ./setup.sh

- name: Test - sqlite env
env:
schemaexplorer_driver: sqlite
schemaexplorer_live: false
run: |
pushd .
cd sqlite
./setup.sh
file="`pwd`/db/test.db" # relative path hack with pwd, otherwise not resolved.
export schemaexplorer_sqlite_file="$file"
popd
export schemaexplorer_sqlite_file="`pwd`/sqlite/db/test.db"
go clean -testcache
go test -v sse_test.go \
2>&1 | go-junit-report -iocopy -set-exit-code -out results-sqlite-env-${{ matrix.go-version }}.xml
- name: Setup - pg
run: |
pushd .
cd pg
./setup-ssetest.sh
popd
working-directory: pg
run: ./setup-ssetest.sh

- name: Test - pg
env:
Expand All @@ -112,16 +107,8 @@ jobs:
2>&1 | go-junit-report -iocopy -set-exit-code -out results-pg-${{ matrix.go-version }}.xml
- name: Setup - mysql
run: |
#!/usr/bin/env bash -v
set -e
pushd .
cd mysql
# Use ip address to stop mysql trying to use sockets, which it does for "localhost"
mysql -h 127.0.0.1 -u root -pomgroot ssetest < test-db.sql
mysql -h 127.0.0.1 -u root -pomgroot ssetest -e "show tables;"
mysql -h 127.0.0.1 -u root -pomgroot ssetest -e "describe CompoundKeyChild;"
popd
working-directory: mysql
run: mysql -h 127.0.0.1 -u root -pomgroot ssetest < test-db.sql

- name: Test - mysql
env:
Expand All @@ -134,13 +121,11 @@ jobs:
2>&1 | go-junit-report -iocopy -set-exit-code -out results-mysql-${{ matrix.go-version }}.xml
- name: Setup - MSSQL
working-directory: mssql
run: |
pushd .
cd mssql
/opt/mssql-tools18/bin/sqlcmd -C -S localhost -W -U sa -P GithubIs2broken -d "master" -Q "create database ssetest;"
/opt/mssql-tools18/bin/sqlcmd -C -S localhost -W -U sa -P GithubIs2broken -d "ssetest" -i test-db.sql
/opt/mssql-tools18/bin/sqlcmd -C -S localhost -W -U sa -P GithubIs2broken -d "ssetest" -i test-db-ms_descriptions.sql
popd
- name: Test - MSSQL
env:
Expand All @@ -151,11 +136,8 @@ jobs:
go test -v sse_test.go \
2>&1 | go-junit-report -iocopy -set-exit-code -out results-MSSQL-${{ matrix.go-version }}.xml
# - name: Upload Go test results
# uses: actions/upload-artifact@v3
# with:
# name: Go-results-${{ matrix.go-version }}
# path: TestResults-${{ matrix.go-version }}.json
# - name: Report Debugger
# run: for x in results-*.xml; do echo ======================= $x =========================; cat $x; done

- name: Test Report
uses: dorny/test-reporter@v1
Expand Down

0 comments on commit f34069e

Please sign in to comment.