-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (49 loc) · 1.31 KB
/
ci.yaml
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
name: Regression Tests
on:
push:
branches:
- main
paths-ignore:
- "**/*.md"
- "LICENSE"
pull_request:
paths-ignore:
- "**/*.md"
- "LICENSE"
jobs:
test:
strategy:
matrix:
go-version: [1.20.x, 1.21.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
cache: true
- name: Tests
run: go run mage.go test
check_changes:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.20.x
- name: Download CRS and Coraza config
run: go run mage.go downloadDeps
# Ref: https://gist.github.com/somidad/3ce6e8a7b7d77ac8fa7fad583003d6f5
- name: Check if there are changes
id: changes
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
- name: Process changes
if: steps.changes.outputs.changed != 0
run: |
echo 'Uncommited changes detected. Run `go run mage.go downloadDeps` to check the changes and commit them.'
exit 1