Skip to content

Parse begin/case as a paren-less command argument #18

Parse begin/case as a paren-less command argument

Parse begin/case as a paren-less command argument #18

Workflow file for this run

name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
# Build, vet, race-test, and enforce 100% coverage. The `ast` package is
# excluded from the gate: it holds only statement-free interface witnesses
# (empty marker methods), which the cover tool cannot attribute.
test:
name: test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version: stable
- run: go version
- run: go vet ./...
- run: go build ./...
- name: Test + 100% coverage gate
shell: bash
run: |
COVERPKG=$(go list ./... | grep -v /ast | paste -sd, -)
go test -race -coverpkg="$COVERPKG" -coverprofile=cover.out ./...
go tool cover -func=cover.out | tail -n 25
cov=$(go tool cover -func=cover.out | tail -1 | awk '{print $3}' | tr -d '%')
echo "coverage: ${cov}%"
awk -v t="$cov" 'BEGIN { exit !(t+0 >= 100.0) }' || {
echo "::error::coverage ${cov}% < 100%"; exit 1; }
# The parser is architecture-independent Go; the org still validates it on all
# six supported 64-bit targets. amd64/arm64 run natively, the rest under qemu.
arch-native:
name: arch ${{ matrix.label }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, label: amd64 }
- { os: ubuntu-24.04-arm, label: arm64 }
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version: stable
- run: go env GOARCH && go test ./...
arch-qemu:
name: arch ${{ matrix.goarch }} (qemu)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- { goarch: riscv64, qemu: qemu-riscv64-static }
- { goarch: loong64, qemu: qemu-loongarch64-static }
- { goarch: ppc64le, qemu: qemu-ppc64le-static }
- { goarch: s390x, qemu: qemu-s390x-static }
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version: stable
- run: sudo apt-get update && sudo apt-get install -y qemu-user-static
- name: Test under qemu (${{ matrix.goarch }})
run: GOARCH=${{ matrix.goarch }} go test -exec=${{ matrix.qemu }} ./...