Skip to content

Commit

Permalink
Collect test-failure artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
rocallahan committed May 26, 2024
1 parent 8f333a4 commit 83fc1ba
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-and-test-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
runner_id:
required: true
type: string
architecture:
required: true
type: string

jobs:
build-and-test:
Expand All @@ -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
2 changes: 1 addition & 1 deletion scripts/github-actions-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 15 additions & 1 deletion scripts/github-actions-test.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

0 comments on commit 83fc1ba

Please sign in to comment.