Add HEAD and ETag to storage service #139
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| name: coverage | |
| "on": | |
| pull_request: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| # Codecov's tokenless upload uses an OIDC id-token instead of a repository upload token. | |
| id-token: write | |
| concurrency: | |
| group: "${{ github.workflow }}-${{ github.ref }}" | |
| cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
| defaults: | |
| run: | |
| shell: bash --noprofile --norc -euo pipefail {0} | |
| env: | |
| MISE_ENV: dart,dotnet,java,js,python,r,rust,zig | |
| jobs: | |
| coverage: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 150 | |
| env: | |
| MISE_ENV: dart,dotnet,java,js,python,r,rust,zig,coverage | |
| ET_TEST_COVERAGE: "true" | |
| steps: | |
| - name: Checkout | |
| # DeepSource's test-coverage analyzer keys the uploaded artifact to the checked-out commit's SHA. | |
| # actions/checkout defaults to the PR *merge* commit, which does not exist upstream, so DeepSource can't | |
| # match it to the run it analyzed and the coverage reads as "never reported" (the check then times out). | |
| # Check out the PR head SHA instead; `|| github.sha` keeps the push-to-main path working. | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| fetch-depth: 1 | |
| persist-credentials: false | |
| - name: Free disk space on Linux | |
| uses: jlumbroso/free-disk-space@v1.3.1 | |
| - name: Install Mesa Vulkan drivers (lavapipe) | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends mesa-vulkan-drivers | |
| - name: Install mise + coverage tools | |
| uses: ./.github/actions/install-mise-tools | |
| timeout-minutes: 20 | |
| with: | |
| github-token: ${{ github.token }} | |
| install-action-tools: cargo-llvm-cov,deepsource | |
| - name: Prefetch dependencies | |
| timeout-minutes: 15 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: mise run prefetch-ci | |
| - name: Build WASM modules | |
| timeout-minutes: 25 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: mise run build-modules | |
| - name: Collect Rust coverage + test results | |
| timeout-minutes: 75 | |
| run: mise run cargo-llvm-cov | |
| # Fold the instrumented wasm guest modules' coverage into lcov.info so it rides the same `rust` flag. | |
| # The WASI + browser modules dumped their .profraw to target/wasi-cov during the runner tests above. | |
| - name: Merge wasm guest coverage into lcov.info | |
| timeout-minutes: 10 | |
| run: mise run wasm-cov | |
| # The browser ws-wasm-agent has no native tests, so it is invisible to the cargo-llvm-cov run above. | |
| # This runs its wasm-bindgen tests in the runner's headless Chrome against an in-process ws-server and folds | |
| # the agent lib's coverage into the same lcov.info. CHROMEWEBDRIVER is the GitHub image's chromedriver that | |
| # matches its preinstalled Chrome; the task falls back to the mise-pinned http:chromedriver when it is unset. | |
| - name: Merge ws-wasm-agent coverage into lcov.info | |
| timeout-minutes: 20 | |
| run: | | |
| export CHROMEDRIVER="${CHROMEWEBDRIVER:+$CHROMEWEBDRIVER/chromedriver}" | |
| mise run wasm-agent-cov | |
| # The pic-viewer display path only runs in a browser, so it is invisible to the cargo-llvm-cov run. | |
| # Its native parse tests already ride that run; this drives the module's wasm-bindgen display tests in | |
| # the same headless Chrome as the ws-wasm-agent step above and folds their lcov into lcov.info. | |
| - name: Merge pic-viewer coverage into lcov.info | |
| timeout-minutes: 20 | |
| run: | | |
| export CHROMEDRIVER="${CHROMEWEBDRIVER:+$CHROMEWEBDRIVER/chromedriver}" | |
| mise run pic-viewer-cov | |
| - name: Collect Python coverage | |
| timeout-minutes: 15 | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| run: mise run pytest-cov | |
| - name: Upload coverage reports as artifacts | |
| if: ${{ !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-reports | |
| path: | | |
| lcov.info | |
| coverage-python.xml | |
| if-no-files-found: error | |
| - name: Upload Rust coverage to Codecov (OIDC) | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| use_oidc: true | |
| files: lcov.info | |
| flags: rust | |
| fail_ci_if_error: true | |
| - name: Upload Python coverage to Codecov (OIDC) | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| use_oidc: true | |
| files: coverage-python.xml | |
| flags: python | |
| fail_ci_if_error: true | |
| - name: Upload Rust coverage to DeepSource (OIDC) | |
| run: deepsource report --analyzer test-coverage --key rust --value-file lcov.info --use-oidc | |
| - name: Upload Python coverage to DeepSource (OIDC) | |
| run: deepsource report --analyzer test-coverage --key python --value-file coverage-python.xml --use-oidc | |
| # Upload test results even when tests failed. | |
| # nextest still wrote the JUnit report, and a failing run is exactly when the per-test results on Codecov | |
| # matter most; `report_type: test_results` selects the JUnit upload path. | |
| - name: Upload test results to Codecov (OIDC) | |
| if: ${{ !cancelled() }} | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| use_oidc: true | |
| report_type: test_results | |
| files: target/nextest/ci/junit.xml | |
| fail_ci_if_error: true |