-
Notifications
You must be signed in to change notification settings - Fork 0
Coverage #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Coverage #75
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4400d2b
Coverage
jayvdb c95ef6b
fixes
jayvdb c50da17
fixes
jayvdb 6085e94
Enable local C# roslynator
jayvdb 87c6a12
claude note
jayvdb 77cbbb7
small fixes
jayvdb b2a7abb
two more
jayvdb 2468a2e
disable doctest coverage
jayvdb 71e70e5
fix actionlint on windows
jayvdb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| --- | ||
| 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: | ||
| # Exact full guest-language set -- gha.rego pins this literal value at the workflow level. | ||
| # (It's what lets `build-modules` build every ws-module so the Rust tests run.) The coverage job appends the | ||
| # `coverage` env at job level below, mirroring test.yaml's override job's `,${{ matrix.compiler }}`. | ||
| MISE_ENV: dart,dotnet,java,js,python,rust,zig | ||
|
|
||
| jobs: | ||
| coverage: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 150 | ||
| env: | ||
| MISE_ENV: dart,dotnet,java,js,python,rust,zig,coverage | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| 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,cargo-nextest | ||
|
|
||
| - 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 | ||
|
|
||
| - name: Upload coverage to Codecov (OIDC) | ||
| uses: codecov/codecov-action@v5 | ||
| with: | ||
| use_oidc: true | ||
| files: lcov.info | ||
| fail_ci_if_error: true | ||
|
|
||
| # 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 |
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Coverage env (MISE_ENV includes `coverage`). | ||
| # A special stackable env like mingw/msvc, not a language -- so it is deliberately NOT in config.toml's ALL_LANGS | ||
| # and the *-all tasks never touch it. Selected only by the coverage workflow, stacked on the language envs it also | ||
| # loads (rust + the guest langs whose ws-modules the coverage build exercises, so the module-loading tests run | ||
| # rather than self-skip). Houses the cargo-llvm-cov task so it stays out of the always-loaded config.toml. | ||
| # cargo-llvm-cov and cargo-nextest are not mise [tools] -- the workflow co-installs them via | ||
| # taiki-e/install-action -- so there is no [tools] table here. | ||
|
|
||
| [tasks.cargo-llvm-cov] | ||
| description = "Rust coverage (cargo-llvm-cov) + JUnit test results (nextest); emits lcov.info + junit.xml" | ||
| # cargo-llvm-cov and cargo-nextest are deliberately NOT mise [tools] (like cargo-unmaintained). | ||
| # The coverage workflow installs both via taiki-e/install-action; this task just runs them. cargo-llvm-cov needs | ||
| # the `llvm-tools-preview` rustup component, which it adds on demand against the mise-managed toolchain. | ||
| # Running the suite through nextest (NEXTEST_PROFILE=ci) emits target/nextest/ci/junit.xml for the Codecov | ||
| # test-results upload; et-ws-web-runner is serialized by the `web-runner` test-group in config/nextest.toml | ||
| # rather than RUST_TEST_THREADS, which nextest ignores; `--config-file config/nextest.toml` selects that config. | ||
| # No `--doc` pass: the workspace sets `[lib] doctest = false` on essentially every crate (doc comments are prose, | ||
| # not runnable examples), and `cargo llvm-cov --doc` ignores that setting -- it drives rustdoc directly and chokes | ||
| # on the generated et-rest-client's backtick prose. So coverage stays on stable, tests-only. `--no-report` defers | ||
| # the report so `report` writes lcov.info from the nextest run's profiles. | ||
| env = { NEXTEST_PROFILE = "ci" } | ||
| run = """ | ||
| cargo llvm-cov --no-report nextest --config-file config/nextest.toml | ||
| cargo llvm-cov report --lcov --output-path lcov.info | ||
| """ | ||
| shell = "bash -euo pipefail -c" |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 HIGH RISK
Correcting this input name from
install-actiontoinstall-action-toolsis vital. GitHub Actions does not error on undeclared inputs, which previously caused theinstall-mise-toolsaction to skip installingcargo-llvm-cov, leading to missing coverage data.