Merge pull request #141 from strongdm/schema-guided-entity-parsing #528
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }' |