Skip to content

Merge branch 'main' into dependabot/go_modules/github.com/lib/pq-1.11.2 #781

Merge branch 'main' into dependabot/go_modules/github.com/lib/pq-1.11.2

Merge branch 'main' into dependabot/go_modules/github.com/lib/pq-1.11.2 #781

Workflow file for this run

name: MySQL tests
on: [push]
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
Test-mysql-integration:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8
env:
MYSQL_DATABASE: libschematest
MYSQL_ROOT_PASSWORD: mysql
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 3306:3306
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b
with:
egress-policy: audit
allowed-endpoints: >
api.github.com:443
codecov.io:443
github.com:443
go.dev:443
golang.org:443
proxy.golang.org:443
storage.googleapis.com:443
uploader.codecov.io:443
- name: Check out repository code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- name: Set up Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417
with:
go-version: '1.21'
- name: Build
run: go build -v ./...
- name: Test
env:
LIBSCHEMA_MYSQL_TEST_DSN: "root:mysql@tcp(127.0.0.1:3306)/libschematest?tls=false"
run: go test ./lsmysql/... -v
- name: Run Coverage
env:
LIBSCHEMA_MYSQL_TEST_DSN: "root:mysql@tcp(127.0.0.1:3306)/libschematest?tls=false"
run: go test -coverprofile=coverage.txt -covermode=atomic -coverpkg=github.com/muir/libschema/... ./lsmysql/...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
files: ./coverage.txt
flags: mysql_tests
name: mysql_tests
verbose: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}