forked from rusefi/rusefi
-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (99 loc) · 3.93 KB
/
Copy pathbuild-simulator.yaml
File metadata and controls
120 lines (99 loc) · 3.93 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Simulator
on:
push:
pull_request:
workflow_dispatch:
env:
AUTOMATION_REF: ${{github.ref_name}}
jobs:
# This is just to ensure the simulator compiles on Linux
build-simulator:
runs-on: ubuntu-latest
strategy:
matrix:
use-clang: ['no', 'yes']
steps:
- uses: actions/checkout@v7
# todo: how to reduce code duplication of submodules list?
- name: Checkout Submodules
run: |
misc/git_scripts/common_submodule_init.sh
- name: Install Clang
if: ${{ matrix.use-clang == 'yes' }}
run: sudo apt-get install -y clang
- name: Print compiler version
working-directory: .
run: |
if [ "${{ matrix.use-clang }}" = "yes" ]; then
clang -v
else
gcc -v
fi
- name: Install multilib
run: |
sudo bash misc/actions/add-ubuntu-latest-apt-mirrors.sh
sudo bash misc/actions/ubuntu-install-tools.sh
- uses: ./.github/actions/setup-java
- name: Generate docs and enums
working-directory: ./firmware/
run: make docs-enums
- name: Gradle autotest java Using freshly generated java code
working-directory: .
run: ./gradlew :autotest:shadowJar :tune-tools:shadowJar
- name: Compile Linux Simulator
working-directory: ./simulator/
run: make -j$(nproc) -r USE_CLANG=${{ matrix.use-clang }}
- name: Run Simulator Functional Test
if: ${{ matrix.use-clang == 'no' }}
working-directory: .
run: ./gradlew simulatorFunctionalTestLauncherWithSimulator
- name: Run Linux Simulator for 10 seconds
if: ${{ matrix.use-clang == 'no' }}
working-directory: ./simulator/
run: ./build/rusefi_simulator 10
- name: Git Status and Simulator generated folder Status
if: ${{ matrix.use-clang == 'no' }}
run: |
git status
ls -l simulator/generated/
- name: Convert .bin from Linux Simulator into .xml
if: ${{ matrix.use-clang == 'no' }}
working-directory: ./simulator/
run: |
export DEFAULT_TUNE_OUTPUT_FOLDER=../simulator/generated/
echo "DEFAULT_TUNE_OUTPUT_FOLDER=$DEFAULT_TUNE_OUTPUT_FOLDER"
./write_tune.sh ../firmware/tunerstudio/generated/rusefi_f407-discovery.ini
- name: Commit fresh generated default simulator tune
if: ${{ matrix.use-clang == 'no' && github.event_name == 'push' && github.ref == 'refs/heads/master'}}
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub gen-default-tune Action"
.github/workflows/bin/smart-git-add.sh "simulator/generated/*msq" 6
.github/workflows/bin/smart-git-add.sh "simulator/generated/canned-tunes/*md" 4
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: [$OUT]"
exit 1
fi
- name: Quick Rebase
if: ${{ matrix.use-clang == 'no' && github.event_name == 'push' && github.ref == 'refs/heads/master'}}
run: |
.github/workflows/bin/git-fast-clean-update.sh
- name: Push fresh default tune
if: ${{ matrix.use-clang == 'no' && 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@v7
with:
name: rusefi_simulator_linux${{ matrix.use-clang == 'yes' && '_clang' || '' }}
path: ./simulator/build/rusefi_simulator