Skip to content
28 changes: 28 additions & 0 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,25 @@ concurrency:
cancel-in-progress: true

jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
rust: ${{ steps.filter.outputs.rust }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cijothomas It has been a while since I worked on this in .NET repo but the issue may be here. What the check-changes outputs gives you is an array of strings IIRC.

Try changing this line to like...

rust: ${{ contains(steps.filter.outputs.changes, 'rust') }}

steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
submodules: true
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
rust:
- 'rust/**'
- '.github/workflows/rust-ci.yml'

test_and_coverage:
needs: check-changes
if: needs.check-changes.outputs.rust == 'true'
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -56,6 +74,8 @@ jobs:
fail_ci_if_error: true

fmt:
needs: check-changes
if: needs.check-changes.outputs.rust == 'true'
strategy:
fail-fast: false
matrix:
Expand All @@ -80,6 +100,8 @@ jobs:
working-directory: ./rust/${{ matrix.folder }}

clippy:
needs: check-changes
if: needs.check-changes.outputs.rust == 'true'
strategy:
fail-fast: false
matrix:
Expand All @@ -105,6 +127,8 @@ jobs:
working-directory: ./rust/${{ matrix.folder }}

deny:
needs: check-changes
if: needs.check-changes.outputs.rust == 'true'
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -149,6 +173,8 @@ jobs:
manifest-path: ./rust/${{ matrix.folder }}/Cargo.toml

docs:
needs: check-changes
if: needs.check-changes.outputs.rust == 'true'
strategy:
fail-fast: false
matrix:
Expand All @@ -172,6 +198,8 @@ jobs:
working-directory: ./rust/${{ matrix.folder }}

structure_check:
needs: check-changes
if: needs.check-changes.outputs.rust == 'true'
strategy:
fail-fast: false
matrix:
Expand Down
Loading