mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-01 19:12:14 +00:00
428fde069d
Two cleanups, neither changing what is built or published. docker.yml loses its type=gha layer cache. The image build compiles nothing — it downloads a release zip and runs apk/apt — so the cache could only save the minute or two those take, against a real correctness problem: with RELEASE=latest the binary URL is resolved by curl inside a RUN layer, and the layer key does not include what it resolved to. A rebuild at the same RELEASE value (a dispatch with version=latest, or a re-run of the same version) would hit the old layer and ship the previous release's binary. mode=max also drew on the same repo-wide 10GB Actions cache quota the Rust lanes are contending for. Only RELEASE is passed as a build-arg now; it is the sole one the Dockerfiles declare besides TARGETARCH. BUILDTIME, VERSION, BUILD_TYPE, REVISION and CHANNEL were read by no stage, and BUILDTIME's $(date ...) was a literal string in the YAML block rather than a substitution. The DOCKER_CHANNEL computation that fed CHANNEL evaluated to "release" down every branch and is gone with it. BUILD_DATE and VCS_REF stay unset even though the Dockerfiles declare them: supplying them would change the published image labels. The setup composite stops installing tools its callers do not use. protobuf- compiler comes out of the apt list entirely — setup-protoc installs 34.1 into the tool cache and prepends it to PATH, so the apt build was shadowed on every run and never used; the same duplicate install is removed from the io_uring lane. musl-tools, zip and unzip move behind install-build-packaging-tools, off for the CI and coverage lanes and left on for build.yml, whose native musl leg needs musl-gcc and whose packaging steps need zip. cargo-nextest and the rustfmt/clippy components move behind install-test-tools, off only for build.yml, which runs no tests and no lints; coverage and the nightly replication lane keep them because both invoke nextest. The action's github-token input is deleted along with its 20 call sites. Its runs block never referenced it — setup-protoc uses github.token directly — so it was 20 places handing a token to something that ignored it. Refs: rustfs/backlog#1598, rustfs/backlog#1600, rustfs/backlog#1603
123 lines
4.9 KiB
YAML
123 lines
4.9 KiB
YAML
# Copyright 2024 RustFS Team
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
# Weekly workspace line-coverage baseline (backlog#1153 infra-5).
|
|
#
|
|
# NON-BLOCKING by design: this workflow only runs on schedule and manual
|
|
# dispatch, so it never attaches a status to a PR and must never be made a
|
|
# required check. It exists to give coverage a visible baseline and trend
|
|
# (per-crate table in the job summary, lcov artifact kept 90 days) — the
|
|
# per-crate ratchet for the security-critical crates builds on it later
|
|
# (backlog#1153 infra-6, report-only first per the ci-11 ladder).
|
|
#
|
|
# Measurement scope matches the PR test gate (ci.yml "Run tests"):
|
|
# `--workspace --exclude e2e_test` with the `ci` nextest profile. Doctests are
|
|
# NOT measured (ci.yml runs them uninstrumented; `cargo llvm-cov` needs a
|
|
# nightly toolchain to cover doctests). Trend-comparison workflow:
|
|
# docs/testing/README.md "Coverage" section. `make coverage` is the local
|
|
# equivalent. Scheduled failures alert via the ci-8 composite action.
|
|
|
|
name: coverage
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
# 07:00 UTC Sunday — staggered clear of the other Sunday crons: ci (00:00),
|
|
# build (01:00), e2e-s3tests (02:00), audit (03:00), nix-flake-update
|
|
# (05:00), mint (06:00), and the daily fuzz (02:00), minio-interop (03:17),
|
|
# e2e-replication-nightly (04:00) and performance-ab (06:00) lanes.
|
|
- cron: "0 7 * * 0"
|
|
|
|
# Only alert-on-failure needs more than read access; it declares its own
|
|
# job-level `issues: write`.
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
coverage:
|
|
name: Workspace coverage (weekly)
|
|
runs-on: sm-standard-4
|
|
# The instrumented build cannot reuse the regular CI cache (different
|
|
# RUSTFLAGS), so a cold week rebuilds the workspace before running the
|
|
# full suite; give it double the test job's 60-minute budget.
|
|
timeout-minutes: 120
|
|
env:
|
|
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
|
|
# Match the PR gate's nextest semantics (ci.yml runs `--profile ci`):
|
|
# retries=0 plus the quarantine list and the ecstore-serial-flaky
|
|
# serialization. Set via env because `cargo llvm-cov`'s own --profile
|
|
# flag selects the *cargo build* profile, not the nextest profile.
|
|
NEXTEST_PROFILE: ci
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
|
|
|
|
- name: Setup Rust environment
|
|
uses: ./.github/actions/setup
|
|
with:
|
|
rust-version: stable
|
|
cache-shared-key: ci-coverage
|
|
cache-save-if: ${{ github.ref == 'refs/heads/main' }}
|
|
install-build-packaging-tools: 'false'
|
|
|
|
- name: Install cargo-llvm-cov
|
|
uses: taiki-e/install-action@bffeee26d4db9be238a4ea78d8826604ebcb594d # v2
|
|
with:
|
|
tool: cargo-llvm-cov
|
|
|
|
- name: Install llvm-tools component
|
|
run: rustup component add llvm-tools-preview
|
|
|
|
- name: Run instrumented test suite
|
|
run: cargo llvm-cov nextest --workspace --exclude e2e_test --no-report
|
|
|
|
- name: Generate lcov and JSON reports
|
|
run: |
|
|
mkdir -p target/llvm-cov
|
|
cargo llvm-cov report --lcov --output-path target/llvm-cov/lcov.info
|
|
cargo llvm-cov report --json --output-path target/llvm-cov/coverage.json
|
|
|
|
- name: Write per-crate summary
|
|
run: python3 scripts/coverage_per_crate.py target/llvm-cov/coverage.json >> "$GITHUB_STEP_SUMMARY"
|
|
|
|
- name: Upload coverage artifact
|
|
if: always()
|
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
|
|
with:
|
|
name: coverage-lcov-${{ github.run_number }}
|
|
path: |
|
|
target/llvm-cov/lcov.info
|
|
target/llvm-cov/coverage.json
|
|
retention-days: 90
|
|
if-no-files-found: ignore
|
|
|
|
alert-on-failure:
|
|
name: Alert on scheduled failure
|
|
needs: [coverage]
|
|
# Only scheduled runs open/append the tracking issue (backlog#1149 ci-8);
|
|
# manual workflow_dispatch runs stay quiet so a debugging run never files a
|
|
# spurious alert.
|
|
if: always() && github.event_name == 'schedule' && contains(needs.*.result, 'failure')
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
steps:
|
|
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
|
|
- name: Open or update failure-tracking issue
|
|
uses: ./.github/actions/schedule-failure-issue
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|