57 lines
1.5 KiB
YAML
57 lines
1.5 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, master]
|
|
pull_request:
|
|
branches: [main, master]
|
|
|
|
jobs:
|
|
openapi:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: "20"
|
|
- name: Lint OpenAPI (Redocly)
|
|
run: npx --yes @redocly/cli@1 lint docs/openapi.yaml
|
|
|
|
go:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.22"
|
|
- name: Vet
|
|
run: go vet ./...
|
|
- name: Test
|
|
run: go test ./... -race -count=1
|
|
- name: Build all commands
|
|
run: |
|
|
set -euxo pipefail
|
|
out="${RUNNER_TEMP}/evobgp-bin"
|
|
mkdir -p "$out"
|
|
for d in cmd/*/; do
|
|
name="$(basename "$d")"
|
|
go build -o "$out/$name" "./$d"
|
|
done
|
|
|
|
bird2:
|
|
runs-on: ubuntu-latest
|
|
needs: [go]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: bird -p on all scenario bird.conf files
|
|
run: |
|
|
set -euxo pipefail
|
|
for conf in internal/birdfmt/testdata/scenarios/*/bird.conf; do
|
|
echo "==> $conf"
|
|
docker run --rm \
|
|
-e "BIRD_CONF=/work/${conf}" \
|
|
-v "$PWD:/work:ro" \
|
|
debian:bookworm-slim \
|
|
bash -ceu 'apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq bird2 >/dev/null && bird -c "$BIRD_CONF" -p'
|
|
done
|