-
-
Notifications
You must be signed in to change notification settings - Fork 29
108 lines (85 loc) · 3.7 KB
/
hardware-ci.yaml
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: HW CI
on: [push, pull_request]
jobs:
build-firmware:
strategy:
# Let all builds finish even if one fails early
fail-fast: false
matrix:
include:
# - build-target: f407-discovery
# script: hardware_ci_f4_discovery
# runs-on: hw-ci-f4-discovery
# test-suite: com.rusefi.HwCiF4Discovery
# folder: config/boards/f407-discovery
# config-name: all
# openocd-script: ../.github/workflows/openocd_ci_f4_discovery.cfg
# serial-device: /dev/serial/by-id/usb-FOME_FOME_Engine_Management_ECU_2B003B000A51343033393930-if01
- build-target: f407-discovery
script: hardware_ci_f4_discovery
runs-on: hw-ci-f4-discovery-2
test-suite: com.rusefi.HwCiF4Discovery
folder: config/boards/f407-discovery
config-name: all
openocd-script: ../.github/workflows/openocd_ci_f4_discovery_2.cfg
serial-device: /dev/serial/by-id/usb-FOME_FOME_Engine_Management_ECU_1E0032000851353238333131-if01
# - build-target: proteus_f4
# script: hardware_ci_proteus
# runs-on: hw-ci-proteus
# test-suite: com.rusefi.HwCiF4Proteus
# folder: config/boards/proteus
# config-name: proteus_f4
# openocd-script: ../.github/workflows/openocd_ci_proteus.cfg
# serial-device: /dev/serial/by-id/usb-FOME_FOME_Engine_Management_ECU_41003D000451383037343335-if01
runs-on: ${{matrix.runs-on}}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Identify Agent
run: uname -a
# huh? why do we gen_config_default here if we gen_config_board later?
- name: Generate Configs for HW CI
working-directory: ./firmware/
run: ./gen_config_default.sh
- name: Generate Enum Strings
working-directory: ./firmware/
run: ./gen_enum_to_string.sh
- name: Generate Board config
working-directory: ./firmware/
run: bash gen_config_board.sh ${{matrix.folder}} ${{matrix.config-name}}
- name: Generate Live Documentation
working-directory: ./firmware/
run: ./gen_live_documentation.sh
- name: Add compiler to PATH
run: echo "$HOME/.rusefi-tools/arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi/bin" >> $GITHUB_PATH
# Make sure the compiler works
- name: Test/Identify Compiler
run: arm-none-eabi-gcc -v
# We aren't guaranteed a clean machine every time, so manually clean the output
- name: Clean Build
working-directory: ./firmware
run: make clean
- name: Set EXTRA env
run: |
echo "EXTRA_2_PARAMS=-DHARDWARE_CI" >> $GITHUB_ENV
echo "HARDWARE_CI_SERIAL_DEVICE=${{matrix.serial-device}}" >> $GITHUB_ENV
- name: Build Firmware
run: bash misc/jenkins/compile_other_versions/compile.sh ${{matrix.folder}} ${{matrix.build-target}}
- name: Check for STLINK
run: lsusb | grep 'ST-LINK\|STLINK'
- name: OpenOCD wipe & flash STM32
working-directory: ./firmware
run: openocd -f "${{matrix.openocd-script}}" -c init -c targets -c "reset halt" -c "flash erase_sector 0 0 11" -c "flash write_image "deliver/fome.bin" 0x08000000" -c "reset run" -c "shutdown"
- name: Generate Java (Antlr)
working-directory: ./java_tools
run: ./gradlew :config_definition:generateGrammarSource
- name: Generate Autotest Jar
working-directory: ./java_tools
run: ./gradlew :autotest:shadowJar
- name: List serial services
run: ls /dev/serial/by-id/
# This both compiles and runs HW CI tests
- name: Run Hardware CI
working-directory: ./java_console
run: ant ${{matrix.script}}