Skip to content

Commit 8ccf051

Browse files
committed
Add CI check
1 parent d70edac commit 8ccf051

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,27 @@ jobs:
102102
- run: cargo test --no-default-features --workspace
103103
- run: cargo test --all-features --workspace
104104

105+
check_crd_previews:
106+
name: Check if CRD previews are up to date
107+
runs-on: ubuntu-latest
108+
steps:
109+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
110+
with:
111+
persist-credentials: false
112+
- uses: dtolnay/rust-toolchain@master
113+
with:
114+
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
115+
- name: Regenerate CRD previews
116+
run: cargo check -p stackable-crd-previewer
117+
- name: Check if committed CRD previews were up to date
118+
run: git diff --exit-code generated-crd-previews
119+
- name: Git Diff showed uncommitted changes
120+
if: ${{ failure() }}
121+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
122+
with:
123+
script: |
124+
core.setFailed('Committed CRD previews were not up to date, please run "cargo check -p stackable-crd-previewer" and re-commit!')
125+
105126
tests_passed:
106127
name: All tests passed
107128
needs:

crates/stackable-crd-previewer/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub enum Error {
3737
}
3838

3939
pub fn main() -> Report<Error> {
40-
Report::capture(|| write_crds())
40+
Report::capture(write_crds)
4141
}
4242

4343
macro_rules! write_crd {

0 commit comments

Comments
 (0)