2021-07-24 13:23:03 -07:00
|
|
|
name: Configs & Live Docs
|
2020-06-18 15:31:54 -07:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
generate:
|
|
|
|
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
|
|
|
|
|
|
|
- name: Checkout Submodules
|
|
|
|
run: |
|
|
|
|
git submodule update --init --depth=1 unit_tests/googletest
|
|
|
|
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-12-15 18:36:37 -08:00
|
|
|
git submodule update --init --depth=1 java_console/peak-can-basic
|
2020-06-18 16:12:58 -07:00
|
|
|
|
2023-11-30 00:06:18 -08:00
|
|
|
- uses: actions/setup-java@v4
|
2023-06-17 11:19:32 -07:00
|
|
|
with:
|
|
|
|
distribution: 'zulu'
|
2023-09-25 14:07:35 -07:00
|
|
|
java-version: '11'
|
2023-06-17 11:19:32 -07:00
|
|
|
|
|
|
|
- name: Test Compiler
|
|
|
|
run: javac -version
|
|
|
|
|
2020-06-28 18:16:14 -07:00
|
|
|
- name: Install Tools
|
2023-01-13 02:35:59 -08:00
|
|
|
run: |
|
2023-02-25 15:07:31 -08:00
|
|
|
sudo bash misc/actions/add-ubuntu-latest-apt-mirrors.sh
|
2023-01-13 02:35:59 -08:00
|
|
|
sudo apt-get install sshpass sshpass mtools
|
2020-06-28 18:16:14 -07:00
|
|
|
|
2024-03-04 18:12:46 -08:00
|
|
|
- name: Configuration Definition and Enum to String CI, without pushing new .jar
|
2023-06-17 11:19:32 -07:00
|
|
|
working-directory: ./java_tools
|
2024-03-04 18:12:46 -08:00
|
|
|
run: |
|
|
|
|
./gradlew :config_definition:shadowJar
|
|
|
|
./gradlew :config_definition_base:shadowJar
|
|
|
|
./gradlew :enum_to_string:shadowJar
|
2023-06-17 11:19:32 -07:00
|
|
|
|
2021-11-28 21:48:19 -08:00
|
|
|
- name: Generate Live Documentation
|
|
|
|
working-directory: ./firmware/
|
2022-08-31 17:43:07 -07:00
|
|
|
run: ./gen_live_documentation.sh
|
2021-11-28 21:48:19 -08:00
|
|
|
|
2021-07-30 16:30:12 -07:00
|
|
|
- name: Generate All Configs
|
2020-06-18 15:31:54 -07:00
|
|
|
working-directory: ./firmware/
|
2020-07-14 07:28:26 -07:00
|
|
|
run: bash gen_config.sh
|
2020-06-18 15:31:54 -07:00
|
|
|
|
2021-12-04 05:17:20 -08:00
|
|
|
# We want to force these files to come from the default "all" config, not the last board generated by gen_config.sh
|
2023-01-31 19:26:25 -08:00
|
|
|
- name: Reset Default Config Files
|
2021-12-04 05:17:20 -08:00
|
|
|
working-directory: ./firmware/
|
|
|
|
run: |
|
|
|
|
git checkout -- ../java_console/models/src/main/java/com/rusefi/config/generated/Fields.java
|
2022-08-27 12:18:17 -07:00
|
|
|
./gen_config_default.sh
|
2021-12-04 05:17:20 -08:00
|
|
|
|
2020-06-18 15:31:54 -07:00
|
|
|
# Commit changes and catch the error that occurs if nothing has been changed (without catching other errors)
|
2020-12-30 07:43:50 -08:00
|
|
|
- name: Commit fresh generated headers and TS project
|
2020-06-18 15:31:54 -07:00
|
|
|
run: |
|
|
|
|
git config --local user.email "action@github.com"
|
2022-08-16 16:41:08 -07:00
|
|
|
git config --local user.name "GitHub gen-configs Action"
|
2021-07-21 16:23:17 -07:00
|
|
|
git add firmware/tunerstudio/generated
|
2021-08-03 19:52:10 -07:00
|
|
|
git add firmware/controllers/generated
|
2023-09-04 18:33:02 -07:00
|
|
|
git add 'firmware/*/*generated*.cpp'
|
|
|
|
git add 'firmware/*/*generated*.h'
|
2022-02-03 11:49:45 -08:00
|
|
|
git add 'firmware/config/boards/*/generated_ts_name_by_pin.cpp'
|
2024-04-03 12:23:34 -07:00
|
|
|
git add 'firmware/console/binary/generated/*.ini'
|
|
|
|
git add 'firmware/controllers/lua/generated/*.md'
|
2023-10-12 13:25:53 -07:00
|
|
|
git add *.java
|
2022-04-29 08:57:48 -07:00
|
|
|
git add *_generated.h
|
2020-06-28 18:25:09 -07:00
|
|
|
git status
|
2024-03-26 20:26:06 -07:00
|
|
|
OUT=$(git commit -m "Auto-generated configs and docs" 2>&1) || echo "commit failed, finding out why"
|
|
|
|
if echo "$OUT" | grep 'nothing to commit\|no changes added'; then
|
2022-04-02 12:14:57 -07:00
|
|
|
echo "headers: looks like nothing to commit"
|
2020-07-19 14:50:22 -07:00
|
|
|
exit 0
|
|
|
|
elif echo "$OUT" | grep 'changed'; then
|
2024-03-26 20:26:06 -07:00
|
|
|
echo "COMMIT=true" >> $GITHUB_ENV
|
2022-04-02 12:14:57 -07:00
|
|
|
echo "headers: looks like something has changed"
|
2020-07-19 14:50:22 -07:00
|
|
|
exit 0
|
|
|
|
else
|
2022-04-02 12:14:57 -07:00
|
|
|
echo "headers: looks like something unexpected"
|
2020-07-19 14:50:22 -07:00
|
|
|
exit 1
|
|
|
|
fi
|
2020-06-18 15:31:54 -07:00
|
|
|
|
2021-07-24 07:20:17 -07:00
|
|
|
- name: Print Compiler version
|
|
|
|
# NOTE: on mac, this is actually symlink'd to clang, not gcc, but that's ok - we want to build on both
|
|
|
|
working-directory: .
|
|
|
|
run: gcc -v
|
|
|
|
|
|
|
|
- name: Build Tests
|
|
|
|
working-directory: ./unit_tests/
|
|
|
|
run: make -j4
|
|
|
|
|
|
|
|
- name: Run Tests
|
|
|
|
working-directory: ./unit_tests/
|
2024-03-15 21:08:14 -07:00
|
|
|
run: build/rusefi_test
|
2021-07-24 07:20:17 -07:00
|
|
|
|
|
|
|
# Commit changes and catch the error that occurs if nothing has been changed (without catching other errors)
|
|
|
|
- name: Commit fresh triggers.txt
|
|
|
|
run: |
|
|
|
|
git status
|
|
|
|
git remote -v
|
|
|
|
echo See https://github.com/rusefi/rusefi/issues/2446
|
|
|
|
git add unit_tests/triggers.txt
|
|
|
|
git status
|
|
|
|
OUT=$(git commit -m "Trigger wheel definitions" unit_tests/triggers.txt 2>&1) || echo "commit failed, finding out why"
|
|
|
|
echo "$OUT"
|
2024-03-26 20:26:06 -07:00
|
|
|
if echo "$OUT" | grep 'nothing to commit\|no changes added'; then
|
2022-04-02 12:14:57 -07:00
|
|
|
echo "triggers: looks like nothing to commit"
|
2021-07-24 07:20:17 -07:00
|
|
|
exit 0
|
|
|
|
elif echo "$OUT" | grep 'changed'; then
|
2024-03-26 20:26:06 -07:00
|
|
|
echo "COMMIT=true" >> $GITHUB_ENV
|
2022-04-02 12:14:57 -07:00
|
|
|
echo "triggers: looks like something has changed"
|
2021-07-24 07:20:17 -07:00
|
|
|
exit 0
|
|
|
|
else
|
2022-04-02 12:14:57 -07:00
|
|
|
echo "triggers: looks like something unexpected"
|
2021-07-24 07:20:17 -07:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2024-03-26 20:26:06 -07:00
|
|
|
- name: Git Pull
|
|
|
|
if: ${{env.COMMIT == 'true'}}
|
2024-03-28 08:06:27 -07:00
|
|
|
run: |
|
|
|
|
git stash
|
|
|
|
git pull --rebase
|
2024-03-26 20:26:06 -07:00
|
|
|
|
2021-07-24 07:20:17 -07:00
|
|
|
- name: Push fresh triggers.txt
|
2024-03-26 20:26:06 -07:00
|
|
|
if: ${{env.COMMIT == 'true'}}
|
2021-07-24 07:20:17 -07:00
|
|
|
uses: ad-m/github-push-action@master
|
|
|
|
with:
|
|
|
|
github_token: ${{ github.token }}
|
2024-03-26 20:26:06 -07:00
|
|
|
branch: ${{ github.ref }}
|