92 lines
3.2 KiB
YAML
92 lines
3.2 KiB
YAML
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@v3
|
|
|
|
- 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
|
|
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '8'
|
|
|
|
- name: Gradle edition of java console
|
|
working-directory: ./java_tools
|
|
run: ./gradlew shadowJar
|
|
|
|
- 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
|
|
|
|
- name: Generate Configs, Enums & Live Documentation
|
|
working-directory: ./firmware/
|
|
run: ./gen_default_everything.sh
|
|
|
|
- name: Compile Linux Simulator
|
|
working-directory: ./simulator/
|
|
run: ./compile.sh
|
|
|
|
- name: Run Linux Simulator for 10 seconds
|
|
working-directory: ./simulator/
|
|
run: ./build/rusefi_simulator 10
|
|
|
|
- name: Load Default Tune from Linux Simulator
|
|
working-directory: ./simulator/
|
|
run: ./write_tune.sh
|
|
|
|
- name: Commit fresh generated default simulator tune
|
|
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"
|
|
git add 'simulator/generated/*xml'
|
|
# get the original ramdisk images back in order to not overwrite the default placeholder
|
|
git checkout -- firmware/hw_layer/mass_storage/ramdisk_image.h firmware/hw_layer/mass_storage/ramdisk_image_compressed.h
|
|
git status
|
|
OUT=$(git commit -am "Auto-generated default tune" 2>&1) || echo "commit failed, finding out why"
|
|
if echo "$OUT" | grep 'nothing to commit'; then
|
|
echo "default tune: looks like nothing to commit"
|
|
echo "::set-env name=NOCOMMIT::true"
|
|
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
|
|
|
|
- name: Push fresh default tune
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && env.NOCOMMIT != 'true'}}
|
|
uses: ad-m/github-push-action@master
|
|
with:
|
|
github_token: ${{ github.token }}
|
|
branch: ${{ steps.extract_branch.outputs.branch }}
|
|
|
|
- name: Upload Linux built simulator
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: rusefi_simulator_linux
|
|
path: ./simulator/build/rusefi_simulator
|