forked from rusefi/rusefi
-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (87 loc) · 3.61 KB
/
build-simulator.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
name: Simulator
on: [push, pull_request]
jobs:
# This is just to ensure the simulator compiles on Linux
build-simulator:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# todo: how to reduce code duplication of submodules list?
- name: Checkout Submodules
run: |
git submodule update --init --depth=1 firmware/ChibiOS
git submodule update --init --depth=1 firmware/ChibiOS-Contrib
git submodule update --init --depth=1 firmware/libfirmware
git submodule update --init --depth=1 firmware/ext/lua
git submodule update --init --depth=1 firmware/controllers/lua/luaaa
git submodule update --init --depth=1 firmware/controllers/can/wideband_firmware
git submodule update --init --depth=1 java_console/luaformatter
git submodule update --init --depth=1 java_console/peak-can-basic
- name: Print GCC version
working-directory: .
run: gcc -v
- name: Install multilib
run: |
sudo bash misc/actions/add-ubuntu-latest-apt-mirrors.sh
sudo apt-get install gcc-multilib g++-multilib mtools dosfstools zip
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '11'
- name: Generate docs and enums
working-directory: ./firmware/
run: make docs-enums
- name: Gradle autotest java Using freshly generated java code
working-directory: ./java_tools
run: ./gradlew :autotest:shadowJar
- name: Compile Linux Simulator
working-directory: ./simulator/
run: make -j$(nproc) -r
- name: Run Simulator Functional Test
working-directory: ./java_tools/
run: ./gradlew simulatorFunctionalTestLauncherWithSimulator
- name: Run Linux Simulator for 10 seconds
working-directory: ./simulator/
run: ./build/rusefi_simulator 10
- name: Git Status and Simulator generated folder Status
run: |
git status
ls -l simulator/generated/
- name: Gradle tune-tools
working-directory: ./java_tools
run: ./gradlew :tune-tools:shadowJar
- name: Convert .bin from Linux Simulator into .xml
working-directory: ./simulator/
run: ./write_tune.sh ../firmware/tunerstudio/generated/rusefi_f407-discovery.ini
- name: Commit fresh generated default simulator tune
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master'}}
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub gen-default-tune Action"
git add "simulator/generated/*msq"
git add "simulator/generated/canned-tunes/*md"
OUT=$(git commit -m "Auto-generated default tune" 2>&1) || echo "commit failed, finding out why"
if echo "$OUT" | grep 'nothing to commit\|no changes added'; then
echo "default tune: looks like nothing to commit"
exit 0
elif echo "$OUT" | grep 'changed'; then
echo "COMMIT=true" >> $GITHUB_ENV
echo "default tune: looks like something has changed"
exit 0
else
echo "default tune: looks like something unexpected"
exit 1
fi
git stash
git pull --rebase
- name: Push fresh default tune
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && env.COMMIT == 'true'}}
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ github.ref }}
- name: Upload Linux built simulator
uses: actions/upload-artifact@v4
with:
name: rusefi_simulator_linux
path: ./simulator/build/rusefi_simulator