feat: add GHA for making sure we run make setup && make
#4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check Generated Files | |
| on: | |
| pull_request: {} | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check-generated: | |
| runs-on: ubuntu-latest | |
| container: returntocorp/ocaml:alpine | |
| steps: | |
| - name: Checkout tree | |
| uses: actions/checkout@v4 | |
| - name: Setup | |
| shell: bash | |
| run: | | |
| git config --global --add safe.directory "$(pwd)" | |
| opam init --disable-sandboxing --yes | |
| eval $(opam env) | |
| apk add py3-pip | |
| pip install check-jsonschema mypy --break-system-packages | |
| make setup | |
| - name: Regenerate files | |
| shell: bash | |
| run: | | |
| eval $(opam env) | |
| make | |
| - name: Check for changes | |
| run: | | |
| git diff --exit-code || { | |
| echo "::error::Generated files are out of date. Please run 'make setup && make' and commit the changes." | |
| git diff --stat | |
| exit 1 | |
| } |