5555 persist-credentials : false
5656 submodules : recursive
5757 fetch-depth : 0
58- - shell : bash
58+ - id : check
59+ shell : bash
5960 run : |
6061 set -x
6162 # - '.github/workflows/build.yaml'
@@ -72,45 +73,55 @@ jobs:
7273 # This is cursed... we use `.[] | .` to remove quotes and any yaml formatting.
7374 readarray -t GLOBS < <(yq --null-input '["*.adoc", ".github/**"]' | yq '.[] | .')
7475
76+ MATCHED="false"
7577 for GLOB in "${GLOBS[@]}"; do
76- git diff --name-only "${BASE_SHA}.." -- "$GLOB"
78+ if ! git diff --exit-code --name-only "${BASE_SHA}.." -- "$GLOB"; then
79+ # When git diff exist with an error, that means there was a diff
80+ # for the glob.
81+ MATCHED="true"
82+ fi
7783 done
7884
79- # cargo-udeps:
80- # name: Run cargo-udeps
81- # needs: [path-filter]
82- # runs-on: ubuntu-latest
83- # env:
84- # RUSTC_BOOTSTRAP: 1
85- # steps:
86- # - name: Install host dependencies
87- # uses: awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # v1.5.3
88- # with:
89- # packages: protobuf-compiler krb5-user libkrb5-dev libclang-dev liblzma-dev libssl-dev pkg-config apt-transport-https
90- # version: ubuntu-latest
85+ echo "MATCHED=$MATCHED" | tee -a "$GITHUB_OUTPUT"
86+ outputs :
87+ matched : ${{ steps.check.outputs.MATCHED }}
9188
92- # - name: Checkout Repository
93- # uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
94- # with:
95- # persist-credentials: false
96- # submodules: recursive
89+ cargo-udeps :
90+ name : Run cargo-udeps
91+ needs : [path-filter]
92+ if : needs.path-filter.outputs.matched == 'true'
93+ runs-on : ubuntu-latest
94+ env :
95+ RUSTC_BOOTSTRAP : 1
96+ steps :
97+ - name : Install host dependencies
98+ uses : awalsh128/cache-apt-pkgs-action@2c09a5e66da6c8016428a2172bd76e5e4f14bb17 # v1.5.3
99+ with :
100+ packages : protobuf-compiler krb5-user libkrb5-dev libclang-dev liblzma-dev libssl-dev pkg-config apt-transport-https
101+ version : ubuntu-latest
97102
98- # - name: Install Rust ${{ env.RUST_TOOLCHAIN_VERSION }} toolchain
99- # uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b
100- # with:
101- # toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
103+ - name : Checkout Repository
104+ uses : actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
105+ with :
106+ persist-credentials : false
107+ submodules : recursive
102108
103- # - name: Setup Rust Cache
104- # uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
105- # with:
106- # cache-all-crates: "true"
107- # key: udeps
109+ - name : Install Rust ${{ env.RUST_TOOLCHAIN_VERSION }} toolchain
110+ uses : dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b
111+ with :
112+ toolchain : ${{ env.RUST_TOOLCHAIN_VERSION }}
113+
114+ - name : Setup Rust Cache
115+ uses : Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
116+ with :
117+ cache-all-crates : " true"
118+ key : udeps
108119
109- # - name: Install cargo-udeps
110- # uses: stackabletech/cargo-install-action@8f7dbbcd2ebe22717efc132d0dd61e80841994b9 # cargo-udeps
120+ - name : Install cargo-udeps
121+ uses : stackabletech/cargo-install-action@8f7dbbcd2ebe22717efc132d0dd61e80841994b9 # cargo-udeps
111122
112- # - name: Run cargo-udeps
113- # run: cargo udeps --workspace --all-targets
123+ - name : Run cargo-udeps
124+ run : cargo udeps --workspace --all-targets
114125
115126 # build-container-image:
116127 # name: Build/Publish ${{ matrix.runner.arch }} Image
0 commit comments