Skip to content

Commit a6e59a2

Browse files
committed
[ci] Build Knowledge Graphs for PRs
1 parent 0d8d529 commit a6e59a2

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

.github/workflows/test-kg.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Test Generate Knowledge Graphs
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
7+
jobs:
8+
test-kg-stmicro:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
family_group:
14+
- name: 'L1_4_U0'
15+
families: [STM32L1, STM32L4, STM32U0]
16+
- name: 'F0_4_H5_WL'
17+
families: [STM32F0, STM32F4, STM32H5, STM32WL]
18+
- name: 'G4_F7'
19+
families: [STM32G4, STM32F7]
20+
- name: 'G0_L0_U5'
21+
families: [STM32G0, STM32L0, STM32U5]
22+
- name: 'C0_F1_2_3_L5_U3_WB'
23+
families: [STM32C0, STM32F1, STM32F2, STM32F3, STM32L5, STM32U3, STM32WB]
24+
- name: 'H7'
25+
families: [STM32H7]
26+
27+
name: Update KG ${{ matrix.family_group.name }}
28+
29+
steps:
30+
- name: Check out Repository
31+
uses: actions/checkout@v4
32+
33+
- name: Setup Python 3.12
34+
uses: actions/setup-python@v4
35+
with:
36+
python-version: "3.12"
37+
38+
- name: Install Python Dependencies
39+
run: |
40+
pip3 install -r tools/requirements.txt -e .
41+
42+
- name: Clone STMicro CubeMX Archive
43+
uses: actions/checkout@v4
44+
with:
45+
repository: modm-ext/archive-stmicro-cubemx
46+
path: ext/stmicro/cubemx
47+
ssh-key: ${{ secrets.SSH_KEY_STMICRO_CUBEMX }}
48+
49+
- name: Clone STMicro Sources
50+
run: |
51+
make ext/arm/cmsis/ ext/stmicro/cubehal/ ext/stmicro/header/
52+
53+
- name: Generate Database for ${{ matrix.family_group.name }}
54+
run: |
55+
FAMILY_LIST='${{ toJson(matrix.family_group.families) }}'
56+
OVERALL_STATUS=0
57+
set +e
58+
59+
for FAMILY in $(echo "$FAMILY_LIST" | jq -r '.[]')
60+
do
61+
echo "::group::Generating database for $FAMILY"
62+
63+
python3 -m modm_data.cube2kg --family $FAMILY
64+
if [ $? -ne 0 ]; then
65+
echo "::error::Database generation for $FAMILY FAILED."
66+
OVERALL_STATUS=1
67+
fi
68+
69+
echo "::endgroup::"
70+
done
71+
72+
exit $OVERALL_STATUS
73+
74+
- name: Upload KG Logs
75+
if: always()
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: logs-${{ matrix.family_group.name }}
79+
path: log/stmicro/kg
80+
retention-days: 7
81+
82+
- name: Upload KGs
83+
if: always()
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: kg-${{ matrix.family_group.name }}
87+
path: ext/stmicro/kg-archive
88+
retention-days: 7

0 commit comments

Comments
 (0)