Skip to content

feat(ci): Ensure that the README.md is in sync with internal/readme #68

feat(ci): Ensure that the README.md is in sync with internal/readme

feat(ci): Ensure that the README.md is in sync with internal/readme #68

Workflow file for this run

name: Test
on:
# Manual trigger
workflow_dispatch:
push:
branches: main
pull_request:
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
- name: Check out code
uses: actions/checkout@v4
- name: Check formatting
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "The following files are not properly formatted:"
echo "$unformatted"
exit 1
fi
echo "All Go files are properly formatted"
readme-check:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
- name: Check out code
uses: actions/checkout@v4
- name: Check README is up-to-date
run: |
cd internal/readme
make
if [ -n "$(git status --porcelain)" ]; then
echo "ERROR: README.md is not up-to-date!"
echo ""
echo "The README.md file differs from what would be generated by running 'make' in internal/readme/."
echo "Please update internal/readme/README.src.md instead of README.md directly,"
echo "then run 'make' in the internal/readme/ directory to regenerate README.md."
echo ""
echo "Changes:"
git status --porcelain
echo ""
echo "Diff:"
git diff
exit 1
fi
echo "README.md is up-to-date"
test:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.23', '1.24' ]
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Check out code
uses: actions/checkout@v4
- name: Test
run: go test -v ./...