You've already forked testing-go-code-with-postgres
mirror of
https://github.com/xorcare/testing-go-code-with-postgres.git
synced 2025-06-30 23:23:40 +02:00
This is needed to display coverage, and as an example of setting up coverage counts. Also, added badges to make the repositories look prettier.
55 lines
1.1 KiB
YAML
55 lines
1.1 KiB
YAML
name: Go
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
jobs:
|
|
test:
|
|
name: test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '1.20'
|
|
cache: false
|
|
|
|
- name: Check that all packages are compiling
|
|
run: make build
|
|
|
|
- name: Check that all integration tests are labeled
|
|
run: make test-short
|
|
|
|
- name: Setup test environment
|
|
run: make test-env-up
|
|
|
|
- name: Run all test
|
|
run: make test
|
|
|
|
- name: Teardown test environment
|
|
run: make test-env-up
|
|
|
|
- name: Upload coverage reports to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
golangci:
|
|
name: lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-go@v4
|
|
with:
|
|
go-version: '1.20'
|
|
cache: false
|
|
- name: golangci-lint
|
|
uses: golangci/golangci-lint-action@v3
|
|
with:
|
|
version: v1.53
|