2021-07-24 13:23:03 -07:00
|
|
|
name: Simulator
|
2019-11-20 20:34:55 -08:00
|
|
|
|
2020-07-08 08:10:24 -07:00
|
|
|
on: [push, pull_request]
|
2019-11-20 20:34:55 -08:00
|
|
|
|
|
|
|
jobs:
|
2020-07-08 08:10:24 -07:00
|
|
|
# This is just to ensure the simulator compiles on Linux
|
|
|
|
build-simulator:
|
2019-11-20 20:34:55 -08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2023-09-05 06:09:12 -07:00
|
|
|
- uses: actions/checkout@v4
|
2023-01-29 01:43:27 -08:00
|
|
|
|
2023-12-15 08:55:25 -08:00
|
|
|
# todo: how to reduce code duplication of submodules list?
|
2023-01-29 01:43:27 -08:00
|
|
|
- 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
|
2023-06-16 14:33:52 -07:00
|
|
|
git submodule update --init --depth=1 java_console/luaformatter
|
2023-12-15 08:55:25 -08:00
|
|
|
git submodule update --init --depth=1 java_console/peak-can-basic
|
2023-01-29 01:43:27 -08:00
|
|
|
|
2022-08-27 15:29:11 -07:00
|
|
|
- name: Print GCC version
|
|
|
|
working-directory: .
|
|
|
|
run: gcc -v
|
|
|
|
|
2020-07-08 08:10:24 -07:00
|
|
|
- name: Install multilib
|
|
|
|
run: |
|
2023-02-25 15:07:31 -08:00
|
|
|
sudo bash misc/actions/add-ubuntu-latest-apt-mirrors.sh
|
2021-07-30 17:18:53 -07:00
|
|
|
sudo apt-get install gcc-multilib g++-multilib mtools dosfstools zip
|
2020-06-18 15:31:54 -07:00
|
|
|
|
2023-11-30 00:06:18 -08:00
|
|
|
- uses: actions/setup-java@v4
|
2023-10-30 19:13:29 -07:00
|
|
|
with:
|
|
|
|
distribution: 'zulu'
|
|
|
|
java-version: '11'
|
|
|
|
|
2024-03-17 06:53:32 -07:00
|
|
|
- name: Generate docs and enums
|
2024-03-06 05:25:27 -08:00
|
|
|
working-directory: ./firmware/
|
|
|
|
run: make docs-enums
|
|
|
|
|
2023-09-25 18:18:20 -07:00
|
|
|
- name: Gradle autotest java Using freshly generated java code
|
|
|
|
working-directory: ./java_tools
|
|
|
|
run: ./gradlew :autotest:shadowJar
|
|
|
|
|
2023-01-08 12:24:50 -08:00
|
|
|
- name: Compile Linux Simulator
|
2019-11-20 20:34:55 -08:00
|
|
|
working-directory: ./simulator/
|
2024-02-06 16:37:06 -08:00
|
|
|
run: make -j$(nproc) -r
|
2020-07-08 08:10:24 -07:00
|
|
|
|
2023-09-11 21:36:35 -07:00
|
|
|
- name: Run Simulator Functional Test
|
2023-10-16 11:51:50 -07:00
|
|
|
working-directory: ./java_tools/
|
|
|
|
run: ./gradlew simulatorFunctionalTestLauncherWithSimulator
|
2023-09-11 21:36:35 -07:00
|
|
|
|
2023-09-13 06:35:22 -07:00
|
|
|
- name: Run Linux Simulator for 10 seconds
|
|
|
|
working-directory: ./simulator/
|
|
|
|
run: ./build/rusefi_simulator 10
|
|
|
|
|
2023-12-10 12:09:49 -08:00
|
|
|
- name: Git Status and Simulator generated folder Status
|
2023-08-19 17:53:34 -07:00
|
|
|
run: |
|
2023-12-10 12:09:49 -08:00
|
|
|
git status
|
|
|
|
ls -l simulator/generated/
|
2023-08-19 17:53:34 -07:00
|
|
|
|
2023-09-27 12:55:06 -07:00
|
|
|
- name: Gradle tune-tools
|
|
|
|
working-directory: ./java_tools
|
|
|
|
run: ./gradlew :tune-tools:shadowJar
|
|
|
|
|
2023-08-19 17:53:34 -07:00
|
|
|
- name: Convert .bin from Linux Simulator into .xml
|
2023-06-16 18:22:40 -07:00
|
|
|
working-directory: ./simulator/
|
|
|
|
run: ./write_tune.sh
|
|
|
|
|
|
|
|
- name: Commit fresh generated default simulator tune
|
2023-08-21 14:02:52 -07:00
|
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
2023-06-16 18:22:40 -07:00
|
|
|
env:
|
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
|
|
|
run: |
|
|
|
|
git config --local user.email "action@github.com"
|
|
|
|
git config --local user.name "GitHub gen-default-tune Action"
|
2024-03-17 06:54:41 -07:00
|
|
|
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"
|
2023-06-16 18:22:40 -07:00
|
|
|
if echo "$OUT" | grep 'nothing to commit'; then
|
|
|
|
echo "default tune: looks like nothing to commit"
|
2023-07-26 06:29:32 -07:00
|
|
|
echo "NOCOMMIT=true" >> $GITHUB_ENV
|
2023-06-16 18:22:40 -07:00
|
|
|
exit 0
|
|
|
|
elif echo "$OUT" | grep 'changed'; then
|
|
|
|
echo "default tune: looks like something has changed"
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
echo "default tune: looks like something unexpected"
|
|
|
|
exit 1
|
|
|
|
fi
|
2023-06-16 17:57:43 -07:00
|
|
|
|
2023-06-16 18:44:29 -07:00
|
|
|
- name: Push fresh default tune
|
2023-06-18 19:33:18 -07:00
|
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && env.NOCOMMIT != 'true'}}
|
2023-06-16 18:44:29 -07:00
|
|
|
uses: ad-m/github-push-action@master
|
|
|
|
with:
|
|
|
|
github_token: ${{ github.token }}
|
|
|
|
branch: ${{ steps.extract_branch.outputs.branch }}
|
|
|
|
|
2023-01-08 12:24:50 -08:00
|
|
|
- name: Upload Linux built simulator
|
2023-12-15 00:37:05 -08:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-07-08 08:10:24 -07:00
|
|
|
with:
|
|
|
|
name: rusefi_simulator_linux
|
|
|
|
path: ./simulator/build/rusefi_simulator
|