ci: Run the generator and fail if output is different (#393)

Make sure the submodule hash, state of the generator and resulting
source files in ash are in sync for every submission.
This commit is contained in:
Marijn Suijten 2021-03-14 11:29:49 +01:00 committed by GitHub
parent 7e9abd2913
commit dba9e6b691
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,31 @@ jobs:
command: check command: check
args: --workspace --all-targets args: --workspace --all-targets
generated:
name: Generated
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Run generator
uses: actions-rs/cargo@v1
with:
command: run
args: -p generator
- name: Format generated results
uses: actions-rs/cargo@v1
with:
command: fmt
args: -p ash
- name: Diff autogen result
run: git diff --quiet || (echo "::error::Generated files are different, please regenerate with cargo run -p generator!"; git diff; false)
test: test:
name: Test Suite name: Test Suite
runs-on: ubuntu-latest runs-on: ubuntu-latest