Skip to content

Add workflow with DTS tests #24

Add workflow with DTS tests

Add workflow with DTS tests #24

Workflow file for this run

---
name: Run DTS tests
on:
pull_request:
# branches:
# - 'main'
jobs:
build-dts:
uses: ./.github/workflows/build.yml
with:
cacheless: false
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
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"
- name: Run tests
shell: bash
env:
LOG_DIR: ${{ steps.log_dirs.outputs.directory }}
run: |
cd open-source-firmware-validation
source venv/bin/activate
source ~/.secrets/dpp-keys
robot -L TRACE -v config:qemu -v rte_ip:127.0.0.1 -v snipeit:no \
-v key1:$KEY1 dasharo-compatibility/dasharo-tools-suite.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 open-source-firmware-validation/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: |
rm -rf open-source-firmware-validation meta-dts build