-
Notifications
You must be signed in to change notification settings - Fork 0
150 lines (129 loc) · 3.82 KB
/
Copy pathpr-ci.yml
File metadata and controls
150 lines (129 loc) · 3.82 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
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
141
142
143
144
145
146
147
148
149
150
name: PR CI
on:
pull_request:
branches:
- main
- master
permissions:
contents: read
jobs:
test:
name: Test (ubuntu)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install libpcap headers (Linux)
run: |
sudo apt-get update
sudo apt-get install -y libpcap-dev
- name: Run unit tests
shell: bash
run: bash scripts/ci/test.sh
quality:
name: Quality (vet + race + lint + vuln)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install libpcap headers
run: |
sudo apt-get update
sudo apt-get install -y libpcap-dev
- name: Race-enabled tests
run: go test -tags all -race -count=1 ./...
# golangci-lint runs via its dedicated action (caching, problem matchers)
# rather than from quality.sh, so it can hook into the GitHub UI; the
# script tolerates it being absent so a local run still covers vet/vuln/
# gosec. The vet + govulncheck + gosec gates are shared with local
# development via scripts/ci/quality.sh / `make quality`.
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: latest
args: --build-tags=all
- name: Quality gates (vet + govulncheck + gosec)
shell: bash
env:
SKIP_LINT: "1" # golangci-lint already ran via its action above
run: bash scripts/ci/quality.sh
build-tags:
name: Build-tag matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tags:
- ""
- "afp"
- "afp macgarden"
- "afp macip"
- "afp macgarden macip"
- "afp sqlite_cnid"
- "all"
- "ipx netbeui smb"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install libpcap headers
run: |
sudo apt-get update
sudo apt-get install -y libpcap-dev
- name: Build with tags="${{ matrix.tags }}"
run: go build -tags "${{ matrix.tags }}" ./...
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
script: bash scripts/ci/build.sh
output: out/classicstack
- os: macos-latest
script: bash scripts/ci/build.sh
output: out/classicstack
- os: windows-latest
script: ./scripts/ci/build.ps1
output: out/classicstack.exe
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install libpcap headers (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libpcap-dev
- name: Build classicstack (Linux/macOS)
if: runner.os != 'Windows'
shell: bash
env:
BUILD_VERSION: 0.0.0-pr.${{ github.run_number }}
BUILD_COMMIT: ${{ github.sha }}
OUTPUT: ${{ matrix.output }}
run: ${{ matrix.script }}
- name: Build classicstack (Windows)
if: runner.os == 'Windows'
shell: pwsh
env:
BUILD_VERSION: 0.0.0-pr.${{ github.run_number }}
BUILD_COMMIT: ${{ github.sha }}
OUTPUT: ${{ matrix.output }}
run: ${{ matrix.script }}