V1 prototype #105
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
tags-ignore: | |
- 'v*' | |
branches: | |
- 'master' | |
pull_request: | |
workflow_call: | |
jobs: | |
ci: | |
uses: smallstep/workflows/.github/workflows/goCI.yml@main | |
with: | |
only-latest-golang: false | |
run-codeql: true | |
run-test: false | |
run-build: false | |
secrets: inherit | |
test: | |
runs-on: ubuntu-latest | |
env: | |
DBPASSWORD: ${{ github.sha }} | |
services: | |
postgres: | |
image: postgres:11-alpine | |
env: | |
POSTGRES_PASSWORD: ${{ env.DBPASSWORD }} | |
ports: | |
- 5432/tcp | |
options: >- | |
--health-cmd "pg_isready -d postgres -U postgres" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ROOT_PASSWORD: ${{ env.DBPASSWORD }} | |
ports: | |
- 3306/tcp | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=5 | |
mariadb: | |
image: mariadb:10.2 | |
env: | |
MARIADB_ROOT_PASSWORD: ${{ env.DBPASSWORD }} | |
ports: | |
- 3306/tcp | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=5 | |
strategy: | |
matrix: | |
go: [ 'stable', 'oldstable' ] | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go }} | |
check-latest: true | |
- name: Install gotestsum | |
run: go install gotest.tools/[email protected] | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run Test Suite | |
run: | | |
gotestsum -- -timeout 10m -race -coverpkg=./... -coverprofile=coverprofile -covermode=atomic ./... | |
env: | |
GOTESTSUM_JSONFILE: gotestsum.json | |
TEST_POSTGRES_DSN: postgres://postgres:${{ env.DBPASSWORD }}@localhost:${{ job.services.postgres.ports['5432'] }}/nosql_test_${{ matrix.go }}?sslmode=disable&connect_timeout=5 | |
TEST_MYSQL_DSN: root:${{ env.DBPASSWORD }}@tcp(localhost:${{ job.services.mysql.ports['3306'] }})/nosql_test_${{ matrix.go }}?timeout=5s | |
TEST_MARIADB_DSN: root:${{ env.DBPASSWORD }}@tcp(localhost:${{ job.services.mariadb.ports['3306'] }})/nosql_test_${{ matrix.go }}?timeout=5s | |
- name: Annotate Test Suite Results | |
if: ${{ (success() || failure()) && hashFiles('gotestsum.json') != '' }} | |
uses: guyarb/[email protected] | |
with: | |
test-results: gotestsum.json |