-
Notifications
You must be signed in to change notification settings - Fork 5
ci(stable-mir-ui): make manual UI workflow runnable #975
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
Open
Stevengre
wants to merge
3
commits into
master
Choose a base branch
from
codex/stable-mir-ui-ci
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+133
−2
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| name: 'Stable MIR UI Tests' | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| test-filter: | ||
| description: 'Passed as -k to pytest (empty = all tests)' | ||
| type: string | ||
| default: '' | ||
| update-skip: | ||
| description: 'Enable --update-skip mode to shrink skip.txt' | ||
| type: boolean | ||
| default: false | ||
| timeout: | ||
| description: 'Per-test timeout in seconds' | ||
| type: string | ||
| default: '300' | ||
|
|
||
| jobs: | ||
| stable-mir-ui-tests: | ||
| name: 'Stable MIR UI Tests' | ||
| runs-on: [self-hosted, linux, normal] | ||
| env: | ||
| CONTAINER_NAME: mir-ui-ci-${{ github.sha }} | ||
| steps: | ||
| - name: 'Check out code' | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| token: ${{ secrets.JENKINS_GITHUB_PAT }} | ||
| submodules: recursive | ||
|
|
||
| - name: 'Resolve Rust revision from stable-mir-json submodule' | ||
| id: stable_mir_json | ||
| run: echo "rust_ref=$(git rev-parse HEAD:deps/stable-mir-json)" >> "${GITHUB_OUTPUT}" | ||
|
|
||
| - name: 'Check out Rust repo' | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: rust-lang/rust | ||
| ref: ${{ steps.stable_mir_json.outputs.rust_ref }} | ||
| path: rust | ||
| fetch-depth: 1 | ||
|
|
||
| - name: 'Set up Docker' | ||
| uses: ./.github/actions/with-docker | ||
| with: | ||
| container-name: ${{ env.CONTAINER_NAME }} | ||
|
|
||
| - name: 'Copy Rust repo into container' | ||
| run: docker cp rust ${{ env.CONTAINER_NAME }}:/home/github-user/workspace/rust | ||
|
|
||
| - name: 'Build stable-mir-json' | ||
| run: docker exec --user github-user ${{ env.CONTAINER_NAME }} make stable-mir-json | ||
|
|
||
| - name: 'Build kmir' | ||
| run: docker exec --user github-user ${{ env.CONTAINER_NAME }} make build | ||
|
|
||
| - name: 'Run stable-mir-ui tests' | ||
| env: | ||
| INPUT_FILTER: ${{ inputs.test-filter }} | ||
| INPUT_TIMEOUT: ${{ inputs.timeout }} | ||
| INPUT_UPDATE_SKIP: ${{ inputs.update-skip }} | ||
| run: | | ||
| test_args=(--timeout="${INPUT_TIMEOUT}") | ||
| if [ -n "${INPUT_FILTER}" ]; then | ||
| test_args+=(-k "${INPUT_FILTER}") | ||
| fi | ||
| if [ "${INPUT_UPDATE_SKIP}" = "true" ]; then | ||
| test_args+=(--update-skip) | ||
| fi | ||
| printf -v test_args_escaped '%q ' "${test_args[@]}" | ||
| docker exec --user github-user \ | ||
| --env RUST_DIR_ROOT=rust \ | ||
| ${{ env.CONTAINER_NAME }} \ | ||
| make test-stable-mir-ui "TEST_ARGS=${test_args_escaped}" | ||
|
|
||
| - name: 'Copy proof artifacts from container' | ||
| if: failure() | ||
| run: | | ||
| rm -rf .github-artifacts/proof-artifacts | ||
| mkdir -p .github-artifacts/proof-artifacts | ||
| docker exec --user github-user ${{ env.CONTAINER_NAME }} bash -lc ' | ||
| set -euo pipefail | ||
| artifact_dir=/home/github-user/workspace/.github-artifacts/proof-artifacts | ||
| rm -rf "$artifact_dir" | ||
| mkdir -p "$artifact_dir" | ||
| find /tmp -type f \( -name show.txt -o -path "*/smir.json" \) -print0 | while IFS= read -r -d "" path; do | ||
| case_dir="$(dirname "$path")" | ||
| if [ "$(basename "$path")" = "smir.json" ]; then | ||
| case_dir="$(dirname "$case_dir")" | ||
| fi | ||
| rel="${case_dir#/tmp/}" | ||
| dest="$artifact_dir/$rel" | ||
| rm -rf "$dest" | ||
| mkdir -p "$(dirname "$dest")" | ||
| cp -R "$case_dir" "$dest" | ||
| done | ||
| ' | ||
| docker cp ${{ env.CONTAINER_NAME }}:/home/github-user/workspace/.github-artifacts/proof-artifacts/. .github-artifacts/proof-artifacts/ || true | ||
|
|
||
| - name: 'Upload proof artifacts on failure' | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: proof-artifacts | ||
| path: .github-artifacts/proof-artifacts | ||
| if-no-files-found: ignore | ||
|
|
||
| - name: 'Copy updated skip.txt from container' | ||
| if: ${{ always() && inputs.update-skip }} | ||
| run: | | ||
| rm -rf .github-artifacts/update-skip | ||
| mkdir -p .github-artifacts/update-skip | ||
| docker cp \ | ||
| ${{ env.CONTAINER_NAME }}:/home/github-user/workspace/kmir/src/tests/external/data/stable-mir-ui/skip.txt \ | ||
| .github-artifacts/update-skip/skip.txt || true | ||
|
|
||
| - name: 'Upload updated skip.txt' | ||
| if: inputs.update-skip | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: updated-skip-txt | ||
| path: .github-artifacts/update-skip/skip.txt | ||
| if-no-files-found: ignore | ||
|
|
||
| - name: 'Tear down Docker' | ||
| if: always() | ||
| run: docker stop --time 0 ${{ env.CONTAINER_NAME }} | ||
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.
This passed CI, so the checkout works. But can you clarify why the commit hash of
stable-mir-jsonis a valid ref forrust-lang/rust?