-
Notifications
You must be signed in to change notification settings - Fork 9
58 lines (49 loc) · 1.66 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
name: ci
on:
push:
branches: [main]
pull_request:
jobs:
test:
strategy:
matrix:
buildtags:
- slicelabels # there's no such tag when this is being written, but it makes the CI job name more obvious.
- stringlabels
- dedupelabels
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v5
with:
go-version: '~1.23.0'
- name: Checkout Repo
uses: actions/checkout@v4
# This file would normally be created by `make assets`, here we just
# mock it because the file is required for the tests to pass.
- name: Mock building of necessary react file
run: mkdir web/ui/static/react && touch web/ui/static/react/index.html
- name: Run Tests
run: GOOPTS=-tags=${{ matrix.buildtags }} make common-test
fuzz:
strategy:
matrix:
include:
- package: ./model/labels
fuzz: FuzzFastRegexMatcher_WithStaticallyDefinedRegularExpressions
- package: ./model/labels
fuzz: FuzzFastRegexMatcher_WithFuzzyRegularExpressions
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-go@v5
with:
go-version: '~1.23.0'
- name: Checkout Repo
uses: actions/checkout@v4
- name: Set -fuzztime=10m for 'main' branch
if: github.ref == 'refs/heads/main'
run: echo "fuzztime=10m" >> $GITHUB_ENV
- name: Set -fuzztime=1m for non-'main' branches
if: github.ref != 'refs/heads/main'
run: echo "fuzztime=1m" >> $GITHUB_ENV
- name: Fuzz
run: go test -run=NOTHING -fuzz=${{ matrix.fuzz }} -fuzztime=$fuzztime ${{ matrix.package }}