@@ -104,6 +104,31 @@ jobs:
104104 # under /srv/hyper, unavailable on a CI runner.
105105 run : mix coveralls.json --no-start --warnings-as-errors
106106
107+ # !cancelled() (not always()) uploads results on test PASS or FAIL -- the
108+ # point of Test Analytics is failure/flake history -- while still skipping
109+ # if the workflow was cancelled. junit_formatter writes the XML at end of
110+ # run regardless of pass/fail. report_type: test_results sends JUnit to
111+ # Test Analytics via codecov-action (the standalone test-results-action is
112+ # deprecated and pinned to Node 20).
113+ - name : Upload test results to Codecov
114+ if : ${{ !cancelled() }}
115+ uses : codecov/codecov-action@v7
116+ with :
117+ token : ${{ secrets.CODECOV_TOKEN }}
118+ files : _build/test/junit.xml
119+ flags : elixir
120+ report_type : test_results
121+
122+ # The artifact feeds the workflow_run publisher (test-results.yml), which
123+ # runs EnricoMi with a write token -- so the GitHub Check works even on
124+ # fork PRs, where this job's token is read-only.
125+ - name : Upload Elixir test results artifact
126+ if : ${{ !cancelled() }}
127+ uses : actions/upload-artifact@v7
128+ with :
129+ name : elixir-test-results
130+ path : _build/test/junit.xml
131+
107132 - name : Upload coverage to Codecov
108133 uses : codecov/codecov-action@v7
109134 with :
@@ -139,13 +164,38 @@ jobs:
139164 - name : clippy
140165 run : cargo clippy --all-targets --all-features -- -D warnings
141166
142- - name : Install cargo-llvm-cov
167+ - name : Install cargo-llvm-cov and nextest
143168 uses : taiki-e/install-action@v2
144169 with :
145- tool : cargo-llvm-cov
170+ tool : cargo-llvm-cov,nextest
146171
147172 - name : test + coverage
148- run : cargo llvm-cov --all-features --lcov --output-path lcov.info
173+ # `nextest` runs the suite while llvm-cov collects coverage AND nextest
174+ # writes target/nextest/ci/junit.xml (see .config/nextest.toml). One run,
175+ # two artifacts: lcov.info for coverage, junit.xml for Test Analytics.
176+ run : cargo llvm-cov nextest --profile ci --all-features --lcov --output-path lcov.info
177+
178+ # !cancelled() uploads on pass OR fail (see elixir job). The action runs at
179+ # repo root, so the path is fully qualified -- working-directory only
180+ # affects `run:` steps, not `uses:` actions. report_type: test_results
181+ # sends JUnit via codecov-action (test-results-action is deprecated/Node 20).
182+ - name : Upload test results to Codecov
183+ if : ${{ !cancelled() }}
184+ uses : codecov/codecov-action@v7
185+ with :
186+ token : ${{ secrets.CODECOV_TOKEN }}
187+ files : native/suidhelper/target/nextest/ci/junit.xml
188+ flags : rust
189+ report_type : test_results
190+
191+ # Repo-relative path: upload-artifact is an action, so the rust job's
192+ # `working-directory: native/suidhelper` default does NOT apply.
193+ - name : Upload Rust test results artifact
194+ if : ${{ !cancelled() }}
195+ uses : actions/upload-artifact@v7
196+ with :
197+ name : rust-test-results
198+ path : native/suidhelper/target/nextest/ci/junit.xml
149199
150200 - name : Upload coverage to Codecov
151201 uses : codecov/codecov-action@v7
@@ -155,3 +205,16 @@ jobs:
155205 files : native/suidhelper/lcov.info
156206 flags : rust
157207 fail_ci_if_error : true
208+
209+ # Uploads the triggering event payload so the workflow_run publisher
210+ # (test-results.yml) can map results back to the originating PR -- required
211+ # for PR comments on fork PRs. Tiny job, always runs.
212+ event_file :
213+ name : Upload event file
214+ runs-on : ubuntu-latest
215+ steps :
216+ - name : Upload
217+ uses : actions/upload-artifact@v7
218+ with :
219+ name : Event File
220+ path : ${{ github.event_path }}
0 commit comments