72 lines
1.6 KiB
YAML
72 lines
1.6 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches: [development]
|
|
pull_request:
|
|
branches: [development]
|
|
|
|
jobs:
|
|
vet:
|
|
runs-on: fedora
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.26"
|
|
|
|
- name: gofmt
|
|
# gofmt -l prints unformatted files; an empty output is the only pass.
|
|
run: |
|
|
unformatted=$(gofmt -l .)
|
|
if [ -n "$unformatted" ]; then
|
|
echo "These files need gofmt:"
|
|
echo "$unformatted"
|
|
exit 1
|
|
fi
|
|
|
|
- name: go vet
|
|
run: go vet ./...
|
|
|
|
test:
|
|
runs-on: fedora
|
|
needs: vet
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.26"
|
|
|
|
- name: Install C compiler
|
|
run: sudo dnf install -y gcc
|
|
|
|
- name: go test -race
|
|
env:
|
|
CGO_ENABLED: "1"
|
|
run: go test -race -count=1 ./...
|
|
|
|
- name: build example
|
|
run: go build ./examples/...
|
|
|
|
toml-test:
|
|
runs-on: fedora
|
|
needs: vet
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.26"
|
|
|
|
- name: Install toml-test
|
|
# A dev/CI tool only; it is not a module dependency of interpres.
|
|
run: go install github.com/toml-lang/toml-test/cmd/toml-test@latest
|
|
|
|
- name: Run the toml-test compliance suite
|
|
run: |
|
|
set -euo pipefail
|
|
go build -o bin/interpres-decode ./cmd/interpres-decode
|
|
"$(go env GOPATH)/bin/toml-test" bin/interpres-decode
|