Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Refactor - Use working-directory #65

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading