Bump github.com/jackc/pgx/v5 from 5.3.1 to 5.5.4 #16
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: GoTestReport | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: read-all | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
mysql: | |
image: mysql:latest | |
env: | |
MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_TEST_DB_PASSWORD }} | |
MYSQL_DATABASE: ${{ secrets.MYSQL_TEST_DB_NAME }} | |
MYSQL_PASSWORD: ${{ secrets.MYSQL_TEST_DB_PASSWORD }} | |
ports: | |
- 3306:3306 | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Wait for MySQL to start | |
run: | | |
echo "Waiting for MySQL to start..." | |
until mysql -h${{ secrets.MYSQL_TEST_DB_HOST }} -uroot -p${{ secrets.MYSQL_TEST_DB_PASSWORD }} -e 'SHOW DATABASES'; do | |
sleep 1 | |
done | |
- name: Create coverage directory | |
run: mkdir -p coverage | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.19 | |
- name: Install gocov and gocover-cobertura | |
run: | | |
go install github.com/axw/gocov/gocov@latest | |
go install github.com/t-yuki/gocover-cobertura@latest | |
- name: Run tests | |
run: | | |
go get -v -t -d ./... | |
go test -race ./app/src/tests/... -count=1 -p 1 -covermode=atomic -coverprofile=coverage/coverage.out | |
- name: Convert coverage | |
run: gocov convert coverage/coverage.out | gocov report 2>&1 | |
- name: Generate coverage report | |
run: | | |
go tool cover -html coverage/coverage.out -o coverage/coverage.html | |
gocover-cobertura < coverage/coverage.out > coverage/coverage.xml |