-
Notifications
You must be signed in to change notification settings - Fork 144
140 lines (139 loc) · 3.82 KB
/
ci-actions.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
---
name: CIRCL
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
amd64_job:
name: Go-${{matrix.GOVER}}/amd64
runs-on: ubuntu-22.04
strategy:
matrix:
GOVER: ['1.23', '1.22']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go-${{ matrix.GOVER }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.GOVER }}
- name: Linting
uses: golangci/golangci-lint-action@v6
with:
version: v1.61.0
install-mode: goinstall
- name: Check shadowing
run: |
go install golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
go vet -vettool=$(which shadow) ./... 2>&1 | awk -f .etc/action.awk
shell: bash
- name: Verifying Code
run: |
go generate -v ./...
test -z "$(git status --porcelain)"
go vet ./...
shell: bash
- name: Building
run: go build -v ./...
- name: Testing
run: go test -v -count=1 ./...
exotic_job:
name: Go-${{matrix.CFG[2]}}/${{matrix.CFG[0]}}
needs: [amd64_job]
runs-on: ubuntu-22.04
strategy:
matrix:
CFG: [[arm64, arm64v8, '1.23']]
steps:
- uses: actions/checkout@v4
- name: Enabling Docker Experimental
run: |
echo $'{\n "experimental": true\n}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
- name: Pulling Images
run: |
docker pull -q multiarch/qemu-user-static
docker pull -q --platform linux/${{matrix.CFG[0]}} ${{matrix.CFG[1]}}/golang:${{matrix.CFG[2]}}
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: Testing
run: |
docker run --rm -v `pwd`:`pwd` -w `pwd` ${{matrix.CFG[1]}}/golang:${{matrix.CFG[2]}} go test -v ./...
build_modes:
needs: [amd64_job]
runs-on: ubuntu-22.04
name: Testing Build Modes
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build as Static
run: make circl_static
- name: Build as Plugin
run: make circl_plugin
coverage_amd64_job:
needs: [amd64_job]
if: github.event_name == 'push'
runs-on: ubuntu-22.04
name: amd64/coverage
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Produce Coverage
run: go test -coverprofile=./coverage.txt ./...
- name: Upload Codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.txt
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
osCompat:
runs-on: ${{ matrix.os }}
needs: [amd64_job]
name: Running on ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Building
run: go build -v ./...
- name: Testing
run: go test -v -count=1 ./...
analyze:
name: Analyze with CodeQL
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: go
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:go"