Skip to content

Commit 2947b2a

Browse files
committed
CI: Use cargo-insta to ensure snapshot correctness
This ensures that unused snapshots do not linger around in the repository, and that snapshot metadata is also correctly updated.
1 parent 5e8deca commit 2947b2a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ env:
1818
CARGO_TERM_COLOR: always
1919
# renovate: datasource=crate depName=cargo-deny versioning=semver
2020
CARGO_DENY_VERSION: 0.18.5
21+
# renovate: datasource=github-releases depName=cargo-insta lookupName=mitsuhiko/insta versioning=semver
22+
CARGO_INSTA_VERSION: 1.43.2
2123
# renovate: datasource=crate depName=cargo-machete versioning=semver
2224
CARGO_MACHETE_VERSION: 0.9.1
2325
# renovate: datasource=github-releases depName=shssoichiro/oxipng versioning=semver
@@ -194,12 +196,15 @@ jobs:
194196
with:
195197
save-if: ${{ github.ref == 'refs/heads/main' }}
196198

199+
- name: Install cargo-insta
200+
run: curl -LsSf https://github.com/mitsuhiko/insta/releases/download/${CARGO_INSTA_VERSION}/cargo-insta-installer.sh | sh
201+
197202
- run: sudo systemctl start postgresql.service
198203
- run: sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'postgres'"
199204

200205
- run: cargo fetch --locked
201206
- run: cargo build --tests --workspace
202-
- run: cargo test --workspace
207+
- run: cargo insta test --require-full-match --unreferenced=reject --workspace
203208
env:
204209
# Set the path to the Fira Sans font for Typst.
205210
TYPST_FONT_PATH: ${{ github.workspace }}/Fira-4.202/otf

0 commit comments

Comments
 (0)