-
Notifications
You must be signed in to change notification settings - Fork 70
47 lines (44 loc) · 1.38 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: test
on:
push:
branches:
- master
pull_request:
jobs:
build:
strategy:
fail-fast: false
matrix:
go: [ '1.19', '1.20', '1.21' ]
os: [windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
show-progress: 'false'
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
cache-dependency-path: "**/go.sum"
- uses: magefile/mage-action@v3
with:
version: v1.15.0
install-only: true
- run: |
go version
go env
mage -version
docker version
# First build to check for compile errors
- run: mage build
# Then lint, taking `.golangci.yml` into account
- uses: golangci/golangci-lint-action@v3
# Finally test all modules
# This starts and stops Docker containers for services like PostgreSQL, Redis etc.
# Takes up to 10m on GitHub Actions
# TODO: Change workflow so that when only one module is changed, only that module's tests are run
- run: mage test all
# Combining of coverage reports not required with the action, which detects all reports in subdirectories and uploads all of them
#- run: build/combine-coverage.sh
# Upload coverage data to codecov.io
- uses: codecov/codecov-action@v2