Files
interpres/.forgejo/workflows/test.yml
T

67 lines
1.6 KiB
YAML
Raw Normal View History

name: Test
on:
push:
branches: [development]
pull_request:
branches: [development]
jobs:
vet:
runs-on: codeberg-small
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/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: codeberg-small
needs: vet
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/actions/setup-go@v5
with:
go-version: "1.26"
- name: go test -race
run: go test -race -count=1 ./...
- name: build example
run: go build ./examples/...
toml-test:
runs-on: codeberg-small
needs: vet
steps:
- uses: https://data.forgejo.org/actions/checkout@v4
- uses: https://data.forgejo.org/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