-
Notifications
You must be signed in to change notification settings - Fork 7
90 lines (90 loc) · 2.89 KB
/
test.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
---
name: Run DTS tests
on:
pull_request:
# branches:
# - 'main'
jobs:
build-dts:
uses: ./.github/workflows/build.yml
run-tests:
name: Run DTS tests
if: ${{ contains(join(needs.*.result, ','), 'success') }}
needs: build-dts
runs-on:
labels: dts-builder
outputs:
qemu_pid: ${{ steps.run_qemu.outputs.qemu_pid }}
steps:
- name: Checkout OSFV repo
uses: actions/checkout@v4
with:
repository: 'Dasharo/open-source-firmware-validation'
path: 'open-source-firmware-validation'
submodules: 'recursive'
ref: 'develop'
- name: Copy DTS binary
shell: bash
run: |
mkdir open-source-firmware-validation/scripts/ci/qemu-data
bmaptool copy \
--bmap build/tmp/deploy/images/genericx86-64/dts-base-image-genericx86-64.wic.bmap \
build/tmp/deploy/images/genericx86-64/dts-base-image-genericx86-64.wic.gz \
open-source-firmware-validation/scripts/ci/qemu-data/dts.img
- name: Install requirements
shell: bash
run: |
cd open-source-firmware-validation
python3 -m virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
- name: Run QEMU
shell: bash
id: run_qemu
run: |
cd open-source-firmware-validation/scripts/ci
qemu-img create -f qcow2 qemu-data/hdd.qcow2 20G
HDD_PATH=qemu-data/dts.img ./qemu-run.sh nographic os &
pid=$!
echo "qemu_pid=$pid" >> "$GITHUB_OUTPUT"
- name: Create directory for logs
shell: bash
id: log_dirs
run: |
timestamp=$(date -u +%Y-%m-%dT%H:%M:%S%Z)
directory="/tmp/dts-test-ci-${timestamp}"
mkdir $directory
echo "directory=$directory" >> "$GITHUB_OUTPUT"
# TODO: Add DPP keys to secrets and use them in tests
- name: Run tests
shell: bash
env:
DPP_EMAIL: ${{ secrets.DPP_EMAIL }}
DPP_PASSWORD: ${{ secrets.DPP_PASSWORD }}
LOG_DIR: ${{ steps.log_dirs.outputs.directory }}
run: |
source venv/bin/activate
robot -L TRACE -v config:qemu -v rte_ip:127.0.0.1 -v snipeit:no \
dts/dts-e2e.robot 2>&1 | tee $LOG_DIR/output.log | grep "| PASS |\|| FAIL |"
- name: Copy log
shell: bash
env:
LOG_DIR: ${{ steps.log_dirs.outputs.directory }}
run: |
cp log.html $LOG_DIR/log.html
cleanup:
name: Cleanup
if: always()
needs: run-tests
runs-on:
labels: dts-builder
steps:
- name: Cleanup after tests
shell: bash
run: |
qemu_pid="${{ needs.run-tests.outputs.qemu_pid }}"
if [ ! -z "$qemu_pid" ]; then
kill $qemu_pid
fi
cd ..
rm -rf open-source-firmware-validation meta-dts build