Skip to content

Commit

Permalink
CI: Attempt to fix more potential template injection issues
Browse files Browse the repository at this point in the history
  • Loading branch information
str4d committed Jan 9, 2025
1 parent 81be266 commit 8a65c78
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ jobs:
cargo doc
--no-deps
--workspace
${{ steps.prepare.outputs.feature-flags }}
${FEATURE_FLAGS}
env:
FEATURE_FLAGS: ${{ steps.prepare.outputs.feature-flags }}
RUSTDOCFLAGS: -Z unstable-options --enable-index-page --cfg docsrs

- name: Move latest rustdocs into book
Expand Down
45 changes: 35 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,13 @@ jobs:
target/
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.lock') }}
- name: Run tests
shell: bash
run: >
cargo test
--workspace
${{ steps.prepare.outputs.feature-flags }}
${FEATURE_FLAGS}
env:
FEATURE_FLAGS: ${{ steps.prepare.outputs.feature-flags }}
- name: Verify working directory is clean
run: git diff --exit-code

Expand Down Expand Up @@ -110,10 +113,13 @@ jobs:
target/
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.lock') }}
- name: Run tests
shell: bash
run: >
cargo test
--workspace
${{ steps.prepare.outputs.feature-flags }}
${FEATURE_FLAGS}
env:
FEATURE_FLAGS: ${{ steps.prepare.outputs.feature-flags }}
- name: Verify working directory is clean
run: git diff --exit-code

Expand Down Expand Up @@ -161,12 +167,15 @@ jobs:
target/
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.lock') }}
- name: Run slow tests
shell: bash
run: >
cargo test
--workspace
${{ steps.prepare.outputs.feature-flags }}
${FEATURE_FLAGS}
--features expensive-tests
-- --ignored
env:
FEATURE_FLAGS: ${{ steps.prepare.outputs.feature-flags }}
- name: Verify working directory is clean
run: git diff --exit-code

Expand Down Expand Up @@ -216,12 +225,15 @@ jobs:
target/
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.lock') }}
- name: Run check
shell: bash
run: >
cargo check
--release
--workspace
--tests
${{ steps.prepare.outputs.feature-flags }}
${FEATURE_FLAGS}
env:
FEATURE_FLAGS: ${{ steps.prepare.outputs.feature-flags }}
- name: Verify working directory is clean
run: git diff --exit-code

Expand Down Expand Up @@ -255,12 +267,15 @@ jobs:
- name: Remove lockfile to build with latest dependencies
run: rm Cargo.lock
- name: Build crates
shell: bash
run: >
cargo build
--workspace
--all-targets
${{ steps.prepare.outputs.feature-flags }}
${FEATURE_FLAGS}
--verbose
env:
FEATURE_FLAGS: ${{ steps.prepare.outputs.feature-flags }}
- name: Verify working directory is clean (excluding lockfile)
run: git diff --exit-code ':!Cargo.lock'

Expand Down Expand Up @@ -369,10 +384,12 @@ jobs:
name: Clippy (MSRV)
token: ${{ secrets.GITHUB_TOKEN }}
args: >
${{ steps.prepare.outputs.feature-flags }}
${FEATURE_FLAGS}
--all-targets
--
-D warnings
env:
FEATURE_FLAGS: ${{ steps.prepare.outputs.feature-flags }}

clippy-beta:
name: Clippy (beta)
Expand All @@ -396,10 +413,12 @@ jobs:
name: Clippy (beta)
token: ${{ secrets.GITHUB_TOKEN }}
args: >
${{ steps.prepare.outputs.feature-flags }}
${FEATURE_FLAGS}
--all-targets
--
-W clippy::all
env:
FEATURE_FLAGS: ${{ steps.prepare.outputs.feature-flags }}

codecov:
name: Code coverage
Expand Down Expand Up @@ -427,10 +446,12 @@ jobs:
run: >
cargo tarpaulin
--engine llvm
${{ steps.prepare.outputs.feature-flags }}
${FEATURE_FLAGS}
--release
--timeout 600
--out xml
env:
FEATURE_FLAGS: ${{ steps.prepare.outputs.feature-flags }}
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
Expand All @@ -451,8 +472,10 @@ jobs:
run: >
cargo doc
--all
${{ steps.prepare.outputs.feature-flags }}
${FEATURE_FLAGS}
--document-private-items
env:
FEATURE_FLAGS: ${{ steps.prepare.outputs.feature-flags }}

fmt:
name: Rustfmt
Expand Down Expand Up @@ -484,7 +507,9 @@ jobs:
run: >
cargo check
--workspace
${{ steps.prepare.outputs.feature-flags }}
${FEATURE_FLAGS}
env:
FEATURE_FLAGS: ${{ steps.prepare.outputs.feature-flags }}
- name: Verify working directory is clean
run: git diff --exit-code

Expand Down

0 comments on commit 8a65c78

Please sign in to comment.