|
@@ -0,0 +1,98 @@
|
|
|
+name: Tests
|
|
|
+
|
|
|
+# Main workflow for tests, it calls all the others through parallel jobs.
|
|
|
+#
|
|
|
+# A final step collects and merges coverage output, then pushes it to
|
|
|
+# coveralls.io
|
|
|
+#
|
|
|
+# https://docs.github.com/en/actions/using-workflows/reusing-workflows
|
|
|
+
|
|
|
+on:
|
|
|
+ push:
|
|
|
+ branches:
|
|
|
+ - master
|
|
|
+ - testing*
|
|
|
+ paths-ignore:
|
|
|
+ - 'README.md'
|
|
|
+ pull_request:
|
|
|
+ branches:
|
|
|
+ - master
|
|
|
+ - testing*
|
|
|
+ paths-ignore:
|
|
|
+ - 'README.md'
|
|
|
+
|
|
|
+jobs:
|
|
|
+
|
|
|
+ go-tests:
|
|
|
+ uses: ./.github/workflows/go-tests.yml
|
|
|
+
|
|
|
+ bats-sqlite:
|
|
|
+ uses: ./.github/workflows/bats-sqlite-coverage.yml
|
|
|
+
|
|
|
+ bats-mariadb:
|
|
|
+ uses: ./.github/workflows/bats-mysql.yml
|
|
|
+ with:
|
|
|
+ database_image: mariadb:latest
|
|
|
+ secrets:
|
|
|
+ DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD}}
|
|
|
+
|
|
|
+ bats-mysql:
|
|
|
+ uses: ./.github/workflows/bats-mysql.yml
|
|
|
+ with:
|
|
|
+ database_image: mysql:latest
|
|
|
+ secrets:
|
|
|
+ DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD}}
|
|
|
+
|
|
|
+ bats-postgres:
|
|
|
+ uses: ./.github/workflows/bats-postgres.yml
|
|
|
+ secrets:
|
|
|
+ DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD}}
|
|
|
+
|
|
|
+ bats-hub:
|
|
|
+ uses: ./.github/workflows/bats-hub.yml
|
|
|
+ secrets:
|
|
|
+ GIST_BADGES_ID: ${{ secrets.GIST_BADGES_ID }}
|
|
|
+ GIST_BADGES_SECRET: ${{ secrets.GIST_BADGES_SECRET }}
|
|
|
+
|
|
|
+ coverage:
|
|
|
+ needs: [go-tests, bats-sqlite]
|
|
|
+ name: Coverage
|
|
|
+ runs-on: ubuntu-latest
|
|
|
+ steps:
|
|
|
+ - name: Set up Go 1.17
|
|
|
+ uses: actions/setup-go@v3
|
|
|
+ with:
|
|
|
+ go-version: 1.17
|
|
|
+ id: go
|
|
|
+
|
|
|
+ - name: Check out code into the Go module directory
|
|
|
+ uses: actions/checkout@v3
|
|
|
+
|
|
|
+ - name: Download unit report
|
|
|
+ uses: actions/download-artifact@v3
|
|
|
+ with:
|
|
|
+ name: coverage.out
|
|
|
+
|
|
|
+ - name: Download bats report
|
|
|
+ uses: actions/download-artifact@v3
|
|
|
+ with:
|
|
|
+ name: coverage-bats.out
|
|
|
+
|
|
|
+ - name: merge coverage reports
|
|
|
+ run: |
|
|
|
+ go get -u github.com/wadey/gocovmerge
|
|
|
+ ~/go/bin/gocovmerge coverage.out coverage-bats.out > coverage-all.out
|
|
|
+
|
|
|
+ - name: gcov2lcov
|
|
|
+ uses: jandelgado/gcov2lcov-action@v1.0.8
|
|
|
+ with:
|
|
|
+ infile: coverage-all.out
|
|
|
+ outfile: coverage-all.txt
|
|
|
+
|
|
|
+ - name: Coveralls
|
|
|
+ uses: coverallsapp/github-action@master
|
|
|
+ continue-on-error: true
|
|
|
+ with:
|
|
|
+ github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
+ path-to-lcov: coverage-all.txt
|
|
|
+
|