Skip to content

Commit 3dd0955

Browse files
committed
wip
1 parent fd4ea51 commit 3dd0955

File tree

2 files changed

+218
-58
lines changed

2 files changed

+218
-58
lines changed

.github/workflows/build.yml

Lines changed: 107 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -5,38 +5,38 @@ on:
55
- dasharo
66

77
jobs:
8-
build_novacustom:
9-
runs-on: ubuntu-22.04
10-
container:
11-
image: coreboot/coreboot-sdk:2021-09-23_b0d87f753c
12-
options: --user 1001
13-
strategy:
14-
matrix:
15-
vendor: [ novacustom ]
16-
model: [ nv4x_adl, ns5x_adl, nv4x_tgl, ns5x_tgl ]
17-
steps:
18-
- name: Checkout repository
19-
uses: actions/checkout@v3
20-
with:
21-
# Checkout pull request HEAD commit instead of merge commit
22-
# See: https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
23-
ref: ${{ github.event.pull_request.head.sha }}
24-
# Fetch complete history
25-
fetch-depth: 0
26-
- name: Checkout all submodules
27-
run: git submodule update --init --recursive --checkout
28-
- name: Build Dasharo
29-
run: |
30-
cp configs/config.${{ matrix.vendor }}_${{ matrix.model }} .config
31-
make olddefconfig
32-
make
33-
- name: Save artifacts
34-
uses: actions/upload-artifact@v2
35-
with:
36-
name: "dasharo-${{ matrix.vendor }}-${{ matrix.model }}-${{ matrix.build }}"
37-
path: |
38-
build/coreboot.rom
39-
retention-days: 30
8+
# build_novacustom:
9+
# runs-on: ubuntu-22.04
10+
# container:
11+
# image: coreboot/coreboot-sdk:2021-09-23_b0d87f753c
12+
# options: --user 1001
13+
# strategy:
14+
# matrix:
15+
# vendor: [ novacustom ]
16+
# model: [ nv4x_adl, ns5x_adl, nv4x_tgl, ns5x_tgl ]
17+
# steps:
18+
# - name: Checkout repository
19+
# uses: actions/checkout@v3
20+
# with:
21+
# # Checkout pull request HEAD commit instead of merge commit
22+
# # See: https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
23+
# ref: ${{ github.event.pull_request.head.sha }}
24+
# # Fetch complete history
25+
# fetch-depth: 0
26+
# - name: Checkout all submodules
27+
# run: git submodule update --init --recursive --checkout
28+
# - name: Build Dasharo
29+
# run: |
30+
# cp configs/config.${{ matrix.vendor }}_${{ matrix.model }} .config
31+
# make olddefconfig
32+
# make
33+
# - name: Save artifacts
34+
# uses: actions/upload-artifact@v2
35+
# with:
36+
# name: "dasharo-${{ matrix.vendor }}-${{ matrix.model }}-${{ matrix.build }}"
37+
# path: |
38+
# build/coreboot.rom
39+
# retention-days: 30
4040
build_msi:
4141
runs-on: ubuntu-22.04
4242
container:
@@ -69,34 +69,83 @@ jobs:
6969
path: |
7070
build/coreboot.rom
7171
retention-days: 30
72-
build_protectli:
73-
environment: Protectli
74-
runs-on: ubuntu-22.04
72+
# build_protectli:
73+
# environment: Protectli
74+
# runs-on: ubuntu-22.04
75+
# strategy:
76+
# matrix:
77+
# vendor: [ protectli ]
78+
# model: [ vp46xx ]
79+
# steps:
80+
# - name: Checkout repository
81+
# uses: actions/checkout@v3
82+
# with:
83+
# # Checkout pull request HEAD commit instead of merge commit
84+
# # See: https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
85+
# ref: ${{ github.event.pull_request.head.sha }}
86+
# # Fetch complete history
87+
# fetch-depth: 0
88+
# - name: Checkout all submodules
89+
# run: git submodule update --init --recursive --checkout
90+
# - name: Obtain Blobs
91+
# shell: bash
92+
# env:
93+
# SSH_KEY: ${{secrets.PROTECTLI_BLOBS_KEY}}
94+
# BLOB_REPO: ${{secrets.PROTECTLI_BLOBS_REPO}}
95+
# run: |
96+
# eval `ssh-agent -s`
97+
# echo "${SSH_KEY}" | ssh-add -
98+
# git clone $BLOB_REPO
99+
# cp -r protectli-blobs/protectli/ 3rdparty/blobs/mainboard/
100+
# - name: Build Dasharo
101+
# run: |
102+
# ./build.sh ${{ matrix.model }}
103+
test_msi:
104+
runs-on: self-hosted
75105
strategy:
76106
matrix:
77-
vendor: [ protectli ]
78-
model: [ vp46xx ]
107+
vendor: [ msi ]
108+
model: [ ms7d25_ddr5 ]
109+
needs: [build_msi]
79110
steps:
80-
- name: Checkout repository
81-
uses: actions/checkout@v3
111+
- name: Set up Python
112+
uses: actions/setup-python@v2
82113
with:
83-
# Checkout pull request HEAD commit instead of merge commit
84-
# See: https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
85-
ref: ${{ github.event.pull_request.head.sha }}
86-
# Fetch complete history
87-
fetch-depth: 0
88-
- name: Checkout all submodules
89-
run: git submodule update --init --recursive --checkout
90-
- name: Obtain Blobs
91-
shell: bash
92-
env:
93-
SSH_KEY: ${{secrets.PROTECTLI_BLOBS_KEY}}
94-
BLOB_REPO: ${{secrets.PROTECTLI_BLOBS_REPO}}
95-
run: |
96-
eval `ssh-agent -s`
97-
echo "${SSH_KEY}" | ssh-add -
98-
git clone $BLOB_REPO
99-
cp -r protectli-blobs/protectli/ 3rdparty/blobs/mainboard/
100-
- name: Build Dasharo
114+
python-version: '3.11'
115+
116+
- name: Fetch CI script
117+
uses: actions/checkout@v4
118+
with:
119+
sparse-checkout: ci.sh
120+
sparse-checkout-cone-mode: false
121+
122+
- name: Checkout test repository
123+
uses: actions/checkout@v4
124+
with:
125+
repository: Dasharo/open-source-firmware-validation
126+
path: validation
127+
128+
- name: Install dependencies
101129
run: |
102-
./build.sh ${{ matrix.model }}
130+
python -m pip install --upgrade pip
131+
pip install -r validation/requirements.txt
132+
133+
- name: Fetch latest firmware
134+
uses: actions/download-artifact@v3
135+
with:
136+
name: dasharo-${{ matrix.vendor }}-${{ matrix.model }}-${{ matrix.build }}
137+
path: dasharo.rom
138+
139+
- name: Flash firmware
140+
shell: bash
141+
run: ./ci.sh -r validation -v "${{ matrix.vendor }}" -m "${{ matrix.model }}" -f dasharo.rom flash
142+
143+
- name: Run tests
144+
shell: bash
145+
run: ./ci.sh -r validation -v "${{ matrix.vendor }}" -m "${{ matrix.model }}" -f dasharo.rom test
146+
147+
- name: Upload test results
148+
uses: actions/upload-artifact@v3
149+
with:
150+
name: test-results
151+
path: test-results

ci.sh

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
vendor=""
6+
model=""
7+
8+
usage() {
9+
echo "Usage: ci.sh -v vendor -m model -f firmware command" 1>&2
10+
exit 1
11+
}
12+
13+
while getopts "r:v:m:f:" o; do
14+
case "${o}" in
15+
r) root="${OPTARG}" ;;
16+
v) vendor="${OPTARG}" ;;
17+
m) model="${OPTARG}" ;;
18+
f) fw_file="${OPTARG}" ;;
19+
*) usage ;;
20+
esac
21+
done
22+
shift $((OPTIND-1))
23+
24+
[ -n "$vendor" ] || usage
25+
[ -n "$model" ] || usage
26+
[ $# -eq 1 ] || usage
27+
28+
command="$1"
29+
[[ "$command" =~ ^(flash|test)$ ]] || usage
30+
shift 1
31+
32+
options=(
33+
-L TRACE
34+
-v snipeit:none
35+
)
36+
37+
compatibility_tests=()
38+
performance_tests=()
39+
security_tests=()
40+
stability_tests=()
41+
42+
case "$vendor" in
43+
msi)
44+
case "$model" in
45+
ms7d25_ddr5)
46+
options+=(
47+
-v device_ip:192.168.10.93
48+
-v rte_ip:192.168.10.188
49+
-v pikvm_ip:192.168.10.45
50+
)
51+
config="msi-pro-z690-a-ddr5"
52+
;;
53+
*)
54+
echo unknown board: $model
55+
exit 1
56+
;;
57+
esac
58+
;;
59+
*)
60+
echo unknown vendor: $vendor
61+
exit 1
62+
;;
63+
esac
64+
65+
if [ "$command" == "flash" ]; then
66+
robot $options[@] -v "fw_file:$fw_file" coreboot/03_flash_coreboot.robot
67+
fi
68+
69+
case "$vendor" in
70+
msi)
71+
case "$model" in
72+
ms7d25_ddr5)
73+
;;
74+
*)
75+
echo unknown board: $model
76+
exit 1
77+
;;
78+
esac
79+
*)
80+
echo unknown vendor: $vendor
81+
exit 1
82+
;;
83+
esac
84+
85+
mkdir test-results
86+
87+
run_robot() {
88+
local category="$1"
89+
local test="$2"
90+
91+
robot -l test-results/dasharo-${category}.log.html \
92+
-r test-results/dasharo-${category}.html \
93+
-p test-results/dasharo-${category}.xml \
94+
${options[@]} "$root/dasharo-${category}/$test.robot"
95+
}
96+
97+
for test in "${compatibility_tests[@]}"; do
98+
run_robot compatibility "$test"
99+
done
100+
101+
for test in "${performance_tests[@]}"; do
102+
run_robot performance "$test"
103+
done
104+
105+
for test in "${security_tests[@]}"; do
106+
run_robot security "$test"
107+
done
108+
109+
for test in "${stability_tests[@]}"; do
110+
run_robot stability "$test"
111+
done

0 commit comments

Comments
 (0)