Debian Codegraph @

.github/workflows/go.yml

raw symbols SCIP
1 name: Go
2
3 on:
4 schedule:
5 # run every Sunday
6 - cron: '0 13 * * 0'
7 push:
8 branches:
9 - main
10 tags:
11 - v[0-9]+.[0-9]+.[0-9]+*
12 pull_request:
13
14 permissions:
15 contents: read
16
17 jobs:
18 build:
19 name: Build
20
21 runs-on: ubuntu-latest
22
23 steps:
24 - name: Install MySQL
25 run: |
26 sudo apt remove --purge mysql* -y
27 sudo apt autoremove -y
28 sudo apt autoclean
29
30 sudo DEBIAN_FRONTEND=noninteractive apt update
31 sudo DEBIAN_FRONTEND=noninteractive apt install -y mysql-server-8.0
32
33 sudo systemctl start mysql.service
34 sudo systemctl status mysql.service
35
36 - name: Checkout code
37 uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
38
39 - name: Set up Go
40 uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
41 with:
42 go-version-file: ${{ github.workspace }}/go.mod
43
44
45 - name: Install development tools
46 run: make init
47
48 - name: Run checks/formatting
49 run: |
50 make check format
51 git diff --exit-code
52
53 - name: Run tests with code coverage
54 run: |
55 go clean -testcache
56 make test-cover
57 make test-race
58
59 - name: Upload coverage results
60 uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
61 with:
62 files: cover.out
63 flags: agent
64 fail_ci_if_error: false
65
66 - name: Run debug commands on failure
67 if: ${{ failure() }}
68 run: |
69 env | sort
70 go env | sort
71 git status