Merge pull request 'Cache pinned OS coverage tool in main CI' (#2) from ci/coverage-tool-cache into main
main-release-gate / verify-and-release (push) Failing after 5m3s
main-release-gate / verify-and-release (push) Failing after 5m3s
This commit was merged in pull request #2.
This commit is contained in:
@@ -19,8 +19,10 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install SSH client
|
||||
run: |
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq --no-install-recommends openssh-client
|
||||
if ! command -v ssh >/dev/null 2>&1; then
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq --no-install-recommends openssh-client
|
||||
fi
|
||||
- name: Render measured benchmark history
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
|
||||
@@ -17,7 +17,34 @@ jobs:
|
||||
CARGO_BUILD_JOBS: 2
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Detect README-only change
|
||||
id: surface
|
||||
run: |
|
||||
surface=full
|
||||
if [ "$GITHUB_EVENT_NAME" = pull_request ] &&
|
||||
{ [ "$GITHUB_BASE_REF" = main ] || [ "$GITHUB_BASE_REF" = next ]; } &&
|
||||
base="$(git merge-base HEAD "origin/$GITHUB_BASE_REF" 2>/dev/null)" &&
|
||||
changed="$(git diff --name-only "$base" HEAD)" &&
|
||||
[ "$changed" = README.md ]; then
|
||||
surface=documentation
|
||||
fi
|
||||
echo "surface=$surface" >> "$GITHUB_OUTPUT"
|
||||
- name: Check README-only change
|
||||
if: steps.surface.outputs.surface == 'documentation'
|
||||
run: |
|
||||
base="$(git merge-base HEAD "origin/$GITHUB_BASE_REF")"
|
||||
git diff --check "$base" HEAD
|
||||
if git grep -nIE '^[[:space:]]*-----BEGIN (RSA |EC |OPENSSH )?PRIVATE KEY-----[[:space:]]*$' --; then
|
||||
echo "private key material found in tracked source" >&2
|
||||
exit 1
|
||||
else
|
||||
status=$?
|
||||
[ "$status" -eq 1 ]
|
||||
fi
|
||||
- name: Check source
|
||||
if: steps.surface.outputs.surface != 'documentation'
|
||||
run: |
|
||||
rustup component add rustfmt
|
||||
cargo fmt --check
|
||||
|
||||
@@ -22,8 +22,10 @@ jobs:
|
||||
fetch-depth: 0
|
||||
- name: Install Pages SSH client
|
||||
run: |
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq --no-install-recommends openssh-client
|
||||
if ! command -v ssh >/dev/null 2>&1; then
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq --no-install-recommends openssh-client
|
||||
fi
|
||||
- name: Install Rust quality tools
|
||||
run: rustup component add rustfmt clippy
|
||||
- name: Formatting
|
||||
@@ -54,12 +56,18 @@ jobs:
|
||||
run: |
|
||||
set -o pipefail
|
||||
cargo test --release --locked -- --ignored --nocapture --test-threads=1 | tee bench-current.txt
|
||||
- name: Restore coverage tool
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: /root/.cargo/bin/cargo-llvm-cov
|
||||
key: cargo-llvm-cov-0.8.7-rust-1.97.1-${{ runner.os }}
|
||||
- name: Coverage tool
|
||||
run: |
|
||||
rustup component add llvm-tools-preview
|
||||
if ! command -v cargo-llvm-cov >/dev/null 2>&1; then
|
||||
cargo install --locked cargo-llvm-cov --version 0.8.7
|
||||
if [ "$(cargo llvm-cov --version 2>/dev/null || true)" != 'cargo-llvm-cov 0.8.7' ]; then
|
||||
cargo install --locked --force cargo-llvm-cov --version 0.8.7
|
||||
fi
|
||||
[ "$(cargo llvm-cov --version)" = 'cargo-llvm-cov 0.8.7' ]
|
||||
- name: Unit test coverage
|
||||
run: |
|
||||
mkdir -p coverage
|
||||
|
||||
Reference in New Issue
Block a user