-
Notifications
You must be signed in to change notification settings - Fork 53
67 lines (54 loc) · 1.4 KB
/
Copy pathci.yml
File metadata and controls
67 lines (54 loc) · 1.4 KB
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
name: CI
on:
push:
branches: [ master, main ]
pull_request:
branches: [ master, main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache-dependency-path: go.sum
- name: Verify dependencies
run: go mod verify
- name: Download dependencies
run: go mod download
- name: Run go vet
run: go vet ./...
- name: Run go fmt check
run: |
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
echo "Code is not formatted. Run 'go fmt ./...'"
gofmt -s -d .
exit 1
fi
- name: Build
run: |
CGO_ENABLED=1 go build -o autoar ./cmd/autoar
chmod +x autoar
- name: Test build
run: |
./autoar --help || true
security:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: '-no-fail -fmt json -out gosec-report.json ./...'
- name: Upload Gosec results
uses: actions/upload-artifact@v4
if: always()
with:
name: gosec-report
path: gosec-report.json