-
Notifications
You must be signed in to change notification settings - Fork 6
/
action.yml
68 lines (58 loc) · 2.37 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: 'Leviathan Action'
description: 'Test your software directly on hardware using the Levaithan Testing framework'
runs:
using: "composite"
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
- name: (Virtual) Leviathan build & test
working-directory: ${{ env.LEVIATHAN_ROOT }}/
if: env.WORKER_TYPE == 'qemu'
shell: bash
run: |
make config
make build
make local-test QEMU_SECUREBOOT=${QEMU_SECUREBOOT} FLASHER_SECUREBOOT=${FLASHER_SECUREBOOT}
- name: (Autokit) Leviathan build & test
working-directory: ${{ env.LEVIATHAN_ROOT }}/
if: env.WORKER_TYPE == 'testbot' || env.WORKER_TYPE == 'autokit'
shell: bash
run: |
make config
make build
make test
- name: Create Summary
if: always()
shell: bash
run: |
echo "### ${TEST_SUITE} Test Report" >> $GITHUB_STEP_SUMMARY
echo "| Total Tests | Ran | Passed | Failed | Skipped |" >> $GITHUB_STEP_SUMMARY
echo "|-------|-----|---------|--------|--------|" >> $GITHUB_STEP_SUMMARY
jq -r '.[0].stats | "\(.tests) 📋 | \(.ran) 🏃 | \(.passed) ✅ | \(.failed) ❌ | \(.skipped) ⏭️"' ${REPORTS}/final-result.json >> $GITHUB_STEP_SUMMARY
echo "#### Failed Tests" >> $GITHUB_STEP_SUMMARY
jq -r '.[0].tests | to_entries[] | select(.value == "failed") | .key' ${REPORTS}/final-result.json >> $GITHUB_STEP_SUMMARY
echo "#### Skipped Tests" >> $GITHUB_STEP_SUMMARY
jq -r '.[0].tests | to_entries[] | select(.value == "skipped") | .key' ${REPORTS}/final-result.json >> $GITHUB_STEP_SUMMARY
- name: Generate artifact name
shell: bash
if: always()
id: report-name
run: |
if [ "$QEMU_SECUREBOOT" -eq 1 ]; then
SB="-sb"
else
SB=""
fi
echo "reportName=reports-${{ env.WORKER_TYPE }}-${{ env.DEVICE_TYPE }}-${{ env.TEST_SUITE }}${SB}" >>"${GITHUB_OUTPUT}"
- uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4
if: always()
with:
name: ${{ steps.report-name.outputs.reportName }}
path: ${{ env.REPORTS }}
- name: Teardown
if: always()
continue-on-error: true
shell: bash
working-directory: ${{ env.LEVIATHAN_ROOT }}
run: |
make down