-
Notifications
You must be signed in to change notification settings - Fork 26
38 lines (28 loc) · 1.14 KB
/
build_and_test.yml
File metadata and controls
38 lines (28 loc) · 1.14 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
name: Verify
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Build
run: go build -v ./...
- name: Test
run: go test -coverprofile=coverage.out ./...
- name: Lint
uses: golangci/golangci-lint-action@v7
- name: Sum type linter
run: go install github.com/alecthomas/go-check-sumtype/cmd/go-check-sumtype@latest && go-check-sumtype -default-signifies-exhaustive=false ./...
- name: Fuzz
run: mkdir -p testdata && go test -fuzz=FuzzParse -fuzztime 60s && go test -fuzz=FuzzTokenize -fuzztime 60s
# Remove generated files from required coverage
- name: Sanitize coverage report
run: sed -i "/^github.com\/cedar-policy\/cedar-go\/internal\/schema\/parser\/cedarschema.go/d" coverage.out
- name: Coverage check
run: go tool cover -func=coverage.out | sed 's/%$//' | awk '{ if ($3 < 100.0) { printf "Insufficient code coverage for %s\n", $0; failed=1 } } END { exit failed }'