Skip to content

Commit 1f97311

Browse files
committed
wip
1 parent fd4ea51 commit 1f97311

File tree

2 files changed

+225
-58
lines changed

2 files changed

+225
-58
lines changed

.github/workflows/build.yml

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

77
jobs:
8-
build_novacustom:
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
40+
build_msi:
941
runs-on: ubuntu-22.04
1042
container:
1143
image: coreboot/coreboot-sdk:2021-09-23_b0d87f753c
1244
options: --user 1001
1345
strategy:
1446
matrix:
15-
vendor: [ novacustom ]
16-
model: [ nv4x_adl, ns5x_adl, nv4x_tgl, ns5x_tgl ]
47+
vendor: [ msi ]
48+
model: [ ms7d25_ddr5 ]
1749
steps:
1850
- name: Checkout repository
1951
uses: actions/checkout@v3
@@ -37,66 +69,83 @@ jobs:
3769
path: |
3870
build/coreboot.rom
3971
retention-days: 30
40-
build_msi:
41-
runs-on: ubuntu-22.04
42-
container:
43-
image: coreboot/coreboot-sdk:2021-09-23_b0d87f753c
44-
options: --user 1001
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
45105
strategy:
46106
matrix:
47107
vendor: [ msi ]
48-
model: [ ms7d25_ddr4, ms7d25_ddr5, ms7e06_ddr4, ms7e06_ddr5 ]
108+
model: [ ms7d25_ddr5 ]
109+
needs: [build_msi]
49110
steps:
50-
- name: Checkout repository
51-
uses: actions/checkout@v3
111+
- name: Set up Python
112+
uses: actions/setup-python@v2
52113
with:
53-
# Checkout pull request HEAD commit instead of merge commit
54-
# See: https://github.com/actions/checkout#checkout-pull-request-head-commit-instead-of-merge-commit
55-
ref: ${{ github.event.pull_request.head.sha }}
56-
# Fetch complete history
57-
fetch-depth: 0
58-
- name: Checkout all submodules
59-
run: git submodule update --init --recursive --checkout
60-
- name: Build Dasharo
61-
run: |
62-
cp configs/config.${{ matrix.vendor }}_${{ matrix.model }} .config
63-
make olddefconfig
64-
make
65-
- name: Save artifacts
66-
uses: actions/upload-artifact@v2
114+
python-version: '3.11'
115+
116+
- name: Fetch CI script
117+
uses: actions/checkout@v4
67118
with:
68-
name: "dasharo-${{ matrix.vendor }}-${{ matrix.model }}-${{ matrix.build }}"
69-
path: |
70-
build/coreboot.rom
71-
retention-days: 30
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
119+
sparse-checkout: ci.sh
120+
sparse-checkout-cone-mode: false
121+
122+
- name: Checkout test repository
123+
uses: actions/checkout@v4
82124
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
125+
repository: Dasharo/open-source-firmware-validation
126+
path: validation
127+
submodules: true
128+
129+
- name: Install dependencies
101130
run: |
102-
./build.sh ${{ matrix.model }}
131+
python -m pip install --upgrade pip
132+
pip install -r validation/requirements.txt
133+
134+
- name: Fetch latest firmware
135+
uses: actions/download-artifact@v3
136+
with:
137+
name: dasharo-${{ matrix.vendor }}-${{ matrix.model }}-${{ matrix.build }}
138+
path: dasharo.rom
139+
140+
- name: Flash firmware
141+
shell: bash
142+
run: ./ci.sh -r validation -v "${{ matrix.vendor }}" -m "${{ matrix.model }}" -f dasharo.rom flash
143+
144+
- name: Run tests
145+
shell: bash
146+
run: ./ci.sh -r validation -v "${{ matrix.vendor }}" -m "${{ matrix.model }}" -f dasharo.rom test
147+
148+
- name: Upload test results
149+
uses: actions/upload-artifact@v3
150+
with:
151+
name: test-results-${{ matrix.vendor }}-${{ matrix.model }}

ci.sh

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
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+
compatibility_tests+=(
74+
custom-boot-menu-key
75+
)
76+
77+
security_tests+=(
78+
me-neuter
79+
)
80+
;;
81+
*)
82+
echo unknown board: $model
83+
exit 1
84+
;;
85+
esac
86+
*)
87+
echo unknown vendor: $vendor
88+
exit 1
89+
;;
90+
esac
91+
92+
mkdir "test-results-$vendor-$model"
93+
94+
run_robot() {
95+
local category="$1"
96+
local test="$2"
97+
98+
robot -l "test-results-$vendor-$model/dasharo-${category}.log.html" \
99+
-r "test-results-$vendor-$model/dasharo-${category}.html" \
100+
-p "test-results-$vendor-$model/dasharo-${category}.xml" \
101+
${options[@]} "$root/dasharo-${category}/$test.robot"
102+
}
103+
104+
for test in "${compatibility_tests[@]}"; do
105+
run_robot compatibility "$test"
106+
done
107+
108+
for test in "${performance_tests[@]}"; do
109+
run_robot performance "$test"
110+
done
111+
112+
for test in "${security_tests[@]}"; do
113+
run_robot security "$test"
114+
done
115+
116+
for test in "${stability_tests[@]}"; do
117+
run_robot stability "$test"
118+
done

0 commit comments

Comments
 (0)