4444 contents : write # for creating branch for pr
4545 pull-requests : write # unused (used in `codegen-automerge: true` case)
4646 security-events : write # for github/codeql-action/*
47- secrets : inherit
47+ secrets :
48+ PR_TOKEN_APP_PRIVATE_KEY : ${{ secrets.PR_TOKEN_APP_PRIVATE_KEY }}
4849 with :
4950 check-external-types : false
5051 docs : false
9192 - name : Test cargo llvm-cov nextest
9293 run : |
9394 unset RUSTFLAGS
94- target="${{ matrix.target }}"
95- if [[ -z "${target}" ]]; then
96- target=$(rustc -vV | grep -E '^host:' | cut -d' ' -f2)
95+ if [[ -z "${TARGET}" ]]; then
96+ TARGET=$(rustc -vV | grep -E '^host:' | cut -d' ' -f2)
9797 fi
9898 cargo llvm-cov nextest --text --fail-under-lines 50
9999 cargo llvm-cov nextest --text --fail-under-lines 50 --profile default --cargo-profile dev
@@ -116,7 +116,7 @@ jobs:
116116 cargo llvm-cov report --nextest-archive-file a.tar.zst --fail-under-lines 70
117117 cargo clean
118118 rm -- a.tar.zst
119- cargo llvm-cov nextest-archive --archive-file a.tar.zst --target "${target }"
119+ cargo llvm-cov nextest-archive --archive-file a.tar.zst --target "${TARGET }"
120120 cargo llvm-cov nextest --archive-file a.tar.zst --text --fail-under-lines 70
121121 cargo llvm-cov report --nextest-archive-file a.tar.zst --fail-under-lines 70
122122 cargo clean
@@ -127,6 +127,8 @@ jobs:
127127 cargo llvm-cov nextest --text --fail-under-lines 100 --profile ci
128128 cargo llvm-cov nextest --text --fail-under-lines 100 --profile ci --cargo-profile dev
129129 cargo clean
130+ env :
131+ TARGET : ${{ matrix.target }}
130132 working-directory : tests/fixtures/crates/bin_crate
131133 - name : Test nightly-specific options, old Cargo compatibility
132134 run : |
@@ -141,9 +143,8 @@ jobs:
141143 "$@"
142144 }
143145 unset RUSTFLAGS
144- target="${{ matrix.target }}"
145- if [[ -z "${target}" ]]; then
146- target=$(rustc -vV | grep -E '^host:' | cut -d' ' -f2)
146+ if [[ -z "${TARGET}" ]]; then
147+ TARGET=$(rustc -vV | grep -E '^host:' | cut -d' ' -f2)
147148 fi
148149
149150 # Test nightly-specific options
@@ -164,7 +165,7 @@ jobs:
164165 popd >/dev/null
165166
166167 # Test minimum runnable Cargo version.
167- case "${{ matrix.target } }" in
168+ case "${TARGET }" in
168169 *-windows-gnullvm) ;; # target unavailable on Rust 1.60.
169170 *)
170171 retry rustup toolchain add 1.60 --no-self-update
@@ -173,6 +174,8 @@ jobs:
173174 popd >/dev/null
174175 ;;
175176 esac
177+ env :
178+ TARGET : ${{ matrix.target }}
176179 if : startsWith(matrix.rust, 'nightly')
177180 - name : Test --dep-coverage
178181 run : |
@@ -187,7 +190,7 @@ jobs:
187190 - name : Test show-env --sh on bash
188191 run : |
189192 bash --version
190- if [[ "${{ matrix.os }} " == "macos"* ]]; then
193+ if [[ "$(uname -s) " == 'Darwin' ]]; then
191194 # macOS's /bin/bash is too old.
192195 cargo llvm-cov show-env --sh > env.sh
193196 # shellcheck disable=SC1091
@@ -479,29 +482,31 @@ jobs:
479482 done
480483 "$@"
481484 }
482- if type -P clang-"${{ matrix.llvm }}" & >/dev/null; then
485+ if type -P clang-"${LLVM_VERSION}" >/dev/null; then
483486 exit 0
484487 fi
485488 codename=$(grep -E '^VERSION_CODENAME=' /etc/os-release | cut -d= -f2)
486489 sudo mkdir -pm755 -- /etc/apt/keyrings
487490 retry curl --proto '=https' --tlsv1.2 -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key \
488491 | sudo gpg --dearmor -o /etc/apt/keyrings/llvm-snapshot.gpg >/dev/null
489- sudo tee -- "/etc/apt/sources.list.d/llvm-toolchain-${codename}-${{ matrix.llvm } }.list" >/dev/null \
490- <<<"deb [signed-by=/etc/apt/keyrings/llvm-snapshot.gpg] http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${{ matrix.llvm } } main"
492+ sudo tee -- "/etc/apt/sources.list.d/llvm-toolchain-${codename}-${LLVM_VERSION }.list" >/dev/null \
493+ <<<"deb [signed-by=/etc/apt/keyrings/llvm-snapshot.gpg] http://apt.llvm.org/${codename}/ llvm-toolchain-${codename}-${LLVM_VERSION } main"
491494 retry sudo apt-get -o Acquire::Retries=10 -qq update
492495 apt_packages=(
493- clang-"${{ matrix.llvm } }"
494- libc++-"${{ matrix.llvm } }"-dev
495- libc++abi-"${{ matrix.llvm } }"-dev
496- libclang-"${{ matrix.llvm } }"-dev
497- lld-"${{ matrix.llvm } }"
498- llvm-"${{ matrix.llvm } }"
499- llvm-"${{ matrix.llvm } }"-dev
496+ clang-"${LLVM_VERSION }"
497+ libc++-"${LLVM_VERSION }"-dev
498+ libc++abi-"${LLVM_VERSION }"-dev
499+ libclang-"${LLVM_VERSION }"-dev
500+ lld-"${LLVM_VERSION }"
501+ llvm-"${LLVM_VERSION }"
502+ llvm-"${LLVM_VERSION }"-dev
500503 )
501504 if ! sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends "${apt_packages[@]}"; then
502505 retry sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 upgrade -y
503506 retry sudo apt-get -o Acquire::Retries=10 -o Dpkg::Use-Pty=0 install -y --no-install-recommends "${apt_packages[@]}"
504507 fi
508+ env :
509+ LLVM_VERSION : ${{ matrix.llvm }}
505510 - run : cargo install --path . --debug
506511 - name : Test
507512 run : |
@@ -515,11 +520,11 @@ jobs:
515520 done
516521 "$@"
517522 }
518- export CC="clang-${{ matrix.llvm } }"
519- export CXX="clang++-${{ matrix.llvm } }"
520- export LLVM_COV="llvm-cov-${{ matrix.llvm } }"
521- export LLVM_PROFDATA="llvm-profdata-${{ matrix.llvm } }"
522- case "${{ matrix.llvm } }" in
523+ export CC="clang-${LLVM_VERSION }"
524+ export CXX="clang++-${LLVM_VERSION }"
525+ export LLVM_COV="llvm-cov-${LLVM_VERSION }"
526+ export LLVM_PROFDATA="llvm-profdata-${LLVM_VERSION }"
527+ case "${LLVM_VERSION }" in
523528 1[4-7])
524529 retry rustup toolchain add 1.60 1.65 1.70 1.73 1.77 --no-self-update
525530 cargo clean
@@ -550,4 +555,6 @@ jobs:
550555 cargo +nightly llvm-cov test --text --include-ffi --fail-under-lines 70 -vv
551556 ;;
552557 esac
558+ env :
559+ LLVM_VERSION : ${{ matrix.llvm }}
553560 working-directory : tests/fixtures/crates/ffi
0 commit comments