-
Notifications
You must be signed in to change notification settings - Fork 19
72 lines (69 loc) · 1.78 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Test
on: push
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
runtime:
- '/var/run/docker.sock'
- '/run/user/$UID/podman/podman.sock'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.21'
- name: Test
run: |
export DOCKER_HOST="unix://${{ matrix.runtime }}"
echo "Using ${DOCKER_HOST}"
go test -race -timeout 0 -coverprofile=coverage.txt -covermode=atomic ./...
- name: Coverage
uses: codecov/codecov-action@v3
with:
file: coverage.txt
linter:
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.21'
- uses: golangci/golangci-lint-action@v3
advanced-security:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.21'
- uses: github/codeql-action/init@v3
with:
languages: 'go'
- uses: github/codeql-action/autobuild@v3
- uses: github/codeql-action/analyze@v3
release:
needs:
- test
- linter
- advanced-security
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: write
if: ${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.21'
- run: make install-release-tool new-patch-release