-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[script] migrate all post CI action to Scala script
- Use nix derivation to cache and capture emulator output - Use built-in S3 nix cache to replace GitHub Artifacts - Produce GitHub step summary in Scala script Signed-off-by: Avimitin <[email protected]>
- Loading branch information
Showing
2 changed files
with
72 additions
and
125 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -157,26 +157,13 @@ jobs: | |
fail-fast: false | ||
matrix: ${{ fromJSON(needs.gen-matrix.outputs.ci-tests) }} | ||
runs-on: [self-hosted, linux, nixos] | ||
outputs: | ||
result: ${{ steps.ci-run.outputs.result }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: "Run testcases" | ||
id: ci-run | ||
run: | | ||
nix develop -c t1-helper runTests --jobs "${{ matrix.jobs }}" \ | ||
--resultDir test-results-$(head -c 10 /dev/urandom | base32) | ||
- uses: actions/upload-artifact@v4 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: test-reports-${{ matrix.id }} | ||
path: | | ||
test-results-*/failed-tests.md | ||
test-results-*/cycle-updates.md | ||
test-results-*/*_cycle.json | ||
nix develop -c t1-helper runTests --jobs "${{ matrix.jobs }}" | ||
report: | ||
name: "Report CI result" | ||
|
@@ -191,21 +178,14 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.head_ref }} | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
pattern: test-reports-* | ||
merge-multiple: true | ||
- name: "Print step summary" | ||
run: | | ||
echo -e "\n## Failed tests\n" >> $GITHUB_STEP_SUMMARY | ||
shopt -s nullglob | ||
cat test-results-*/failed-tests.md >> $GITHUB_STEP_SUMMARY | ||
echo -e "\n## Cycle updates\n" >> $GITHUB_STEP_SUMMARY | ||
shopt -s nullglob | ||
cat test-results-*/cycle-updates.md >> $GITHUB_STEP_SUMMARY | ||
nix develop -c t1-helper postCI --failed-test-file-path ./failed-test.md --cycle-update-file-path ./cycle-update.md | ||
cat ./failed-test.md >> $GITHUB_STEP_SUMMARY | ||
echo >> $GITHUB_STEP_SUMMARY | ||
cat ./cycled-update.md >> $GITHUB_STEP_SUMMARY | ||
- name: "Commit cycle updates" | ||
run: | | ||
nix develop -c t1-helper mergeCycleData | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
changed_cases=$(git diff --name-only '.github/cases/**/default.json') | ||
|
@@ -218,17 +198,3 @@ jobs: | |
else | ||
echo "No cycle change detect" | ||
fi | ||
- uses: geekyeggo/delete-artifact@v5 | ||
with: | ||
# test-reports has been used, it can be deleted | ||
name: test-reports-* | ||
|
||
clean-after-cancelled: | ||
name: "Clean test reports [ON CANCELLED]" | ||
if: ${{ cancelled() }} | ||
runs-on: [self-hosted, linux, nixos] | ||
needs: [run-testcases] | ||
steps: | ||
- uses: geekyeggo/delete-artifact@v5 | ||
with: | ||
name: test-reports-* |
This file contains 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