diff --git a/.github/workflows/build-and-test-main.yml b/.github/workflows/build-and-test-main.yml index 6ec858e9ddd..97f51f25d86 100644 --- a/.github/workflows/build-and-test-main.yml +++ b/.github/workflows/build-and-test-main.yml @@ -26,12 +26,14 @@ jobs: needs: setup with: runner_id: ${{ needs.setup.outputs.RUNNER_ID }}_x86_64 + architecture: x86_64 arm64: uses: ./.github/workflows/build-and-test.yml needs: setup with: runner_id: ${{ needs.setup.outputs.RUNNER_ID }}_arm64 + architecture: arm64 stop-runners: name: Stop runners diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 8b8bc7ef4f5..73ba835c349 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -6,6 +6,9 @@ on: runner_id: required: true type: string + architecture: + required: true + type: string jobs: build-and-test: @@ -20,4 +23,12 @@ jobs: run: ./scripts/github-actions-build.sh - name: Test + id: test run: ./scripts/github-actions-test.sh + + - uses: actions/upload-artifact@v4 + if: failure() && steps.test.outcome == 'failure' + with: + name: failed-tests-${{ inputs.architecture }} + path: failed-tests/* + compression-level: 0 diff --git a/scripts/github-actions-build.sh b/scripts/github-actions-build.sh index 51ab6c784d9..ee6b5c070d9 100755 --- a/scripts/github-actions-build.sh +++ b/scripts/github-actions-build.sh @@ -7,7 +7,7 @@ uname -a EXTRA_PACKAGES= MACHINE_TYPE=`uname -m` -if [ ${MACHINE_TYPE} == 'x86_64' ]; then +if [ $MACHINE_TYPE == 'x86_64' ]; then EXTRA_PACKAGES=g++-multilib fi diff --git a/scripts/github-actions-test.sh b/scripts/github-actions-test.sh index 18b886aa961..892bb027993 100755 --- a/scripts/github-actions-test.sh +++ b/scripts/github-actions-test.sh @@ -1,7 +1,6 @@ #!/bin/bash set +x # echo commands -set -e # default to exiting on error" # Enable perf events for rr echo 0 | sudo tee /proc/sys/kernel/perf_event_paranoid > /dev/null @@ -12,3 +11,18 @@ echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope > /dev/null let halfproc=`nproc`/2 cd obj ctest -j$halfproc --verbose + +STATUS=$? +if [[ $STATUS != 0 ]]; then + mkdir $GITHUB_WORKSPACE/failed-tests + cd /tmp + rm rr-test-cpu-lock || true + for dir in rr-test-*; do + echo "Packing test /tmp/$dir" + $GITHUB_WORKSPACE/obj/bin/rr pack $dir/latest-trace + tar zcf $GITHUB_WORKSPACE/failed-tests/$dir.tar.gz $dir + rm -rf $dir + done +fi + +exit $STATUS