Files

47 lines
1.6 KiB
YAML

# Checks every pull request, and main: the Go tests, the editor's tests and
# types, and that the committed editor interface (internal/editor/ui/dist,
# embedded in the binary) is what its source builds to.
#
# Job images are pinned by digest; the only actions are coffey-labs/actions
# ones pinned by SHA.
name: ci
on:
pull_request:
push:
branches: [main]
defaults:
run:
shell: bash
jobs:
go:
runs-on: light
container:
image: golang:1.26-bookworm@sha256:a688600ca24f8a4d3ca77f95b0dd40704a9fc787c826660eb7ba0b641b8b175d # 1.26-bookworm
steps:
- uses: coffey-labs/actions/checkout@fab0c4d45e0162963965f1555df27b7bed5e20ec
- run: test -z "$(gofmt -l cmd internal packs starter)" || { gofmt -l cmd internal packs starter; exit 1; }
- run: go vet ./...
- run: go test -count=1 ./...
editor-ui:
runs-on: light
container:
image: node:22-bookworm-slim@sha256:48e4b67d85f87bd551df43704e24d252f56cc5f8e9718841aace50f19948f0f9 # 22-bookworm-slim
defaults:
run:
working-directory: editor-ui
steps:
- uses: coffey-labs/actions/checkout@fab0c4d45e0162963965f1555df27b7bed5e20ec
- run: npm ci
- run: npx tsc --noEmit -p .
- run: npm test
- name: The committed interface matches its source
run: |
npm run build
cd .. && git config --global --add safe.directory "$PWD"
git status --porcelain internal/editor/ui/dist | tee /dev/stderr | (! grep -q .) \
|| { echo "internal/editor/ui/dist is out of date: run npm run build in editor-ui/ and commit it" >&2; exit 1; }