Bump cmark #84
This file contains 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: PR Checks | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
strategy: | |
matrix: | |
go_version: | |
- "1.20" | |
- "1.21" | |
os: | |
- windows-latest | |
- ubuntu-latest | |
- macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: setup go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go_version }} | |
- name: install go-cov | |
run: go install gitlab.com/matthewhughes/go-cov/cmd/go-cov | |
- name: run tests | |
run: | | |
go test -coverprofile cov.out ./... | |
go-cov cov.out > go-cov.out | |
- name: check coverage | |
shell: bash | |
run: > | |
awk ' | |
BEGIN {fail = 0} | |
NR > 1 && $NF == 0 { fail = 1; printf("bad line: %s\n", $0) } | |
END { if (fail) { exit(1) } }' go-cov.out | |
golangci-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
- name: setup go | |
uses: actions/setup-go@v4 | |
with: | |
cache: false | |
- name: golangci-lint | |
uses: golangci/golangci-lint-action@v3 | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
- uses: pre-commit/[email protected] | |
env: | |
# run this separately since it handles it's own caching | |
SKIP: golangci-lint | |
check-generated-code: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: setup go | |
uses: actions/setup-go@v4 | |
- name: generate code | |
run: go generate ./... | |
- name: check for changes in generated code | |
run: | | |
git add pkg | |
if ! git diff --quiet -- pkg | |
then | |
echo 'changes detected from `go generate`' >&2 | |
exit 1 | |
fi | |