Run 'cargo xtask codegen' in CI and check that there are no diffs
This commit is contained in:
committed by
Dustin J. Mitchell
parent
75e10676ce
commit
a0703af0b9
38
.github/workflows/checks.yml
vendored
38
.github/workflows/checks.yml
vendored
@@ -56,7 +56,7 @@ jobs:
|
||||
- name: Setup mdBook
|
||||
uses: peaceiris/actions-mdbook@v1
|
||||
with:
|
||||
# if this changes, change it in cli/Cargo.toml and .github/workflows/publish-docs.yml as well
|
||||
# if this changes, change it in .github/workflows/publish-docs.yml as well
|
||||
mdbook-version: '0.4.10'
|
||||
|
||||
- run: mdbook test taskchampion/docs
|
||||
@@ -80,3 +80,39 @@ jobs:
|
||||
command: fmt
|
||||
args: --all -- --check
|
||||
|
||||
codegen:
|
||||
runs-on: ubuntu-latest
|
||||
name: "codegen"
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Cache cargo registry
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: ~/.cargo/registry
|
||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- name: Cache cargo build
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: target
|
||||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
# Same as the MSRV in rust-tests.yml
|
||||
toolchain: "1.64"
|
||||
override: true
|
||||
|
||||
- uses: actions-rs/cargo@v1.0.3
|
||||
with:
|
||||
command: run
|
||||
args: --package xtask -- codegen
|
||||
|
||||
- name: check for changes
|
||||
run: |
|
||||
if ! git diff; then
|
||||
echo "Generated code not up-to-date;
|
||||
run `cargo run --package xtask -- codegen` and commit the result";
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
2
.github/workflows/publish-docs.yml
vendored
2
.github/workflows/publish-docs.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
- name: Setup mdBook
|
||||
uses: peaceiris/actions-mdbook@v1
|
||||
with:
|
||||
# if this changes, change it in cli/Cargo.toml and .github/workflows/publish-docs.yml as well
|
||||
# if this changes, change it in .github/workflows/publish-docs.yml as well
|
||||
mdbook-version: '0.4.10'
|
||||
|
||||
- run: mdbook build taskchampion/docs
|
||||
|
||||
Reference in New Issue
Block a user