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:
|
2022-07-27 02:47:07 -07:00
|
|
|
- uses: actions/checkout@v3
|
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
|
2020-06-18 16:12:58 -07:00
|
|
|
|
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
|
|
|
|
2020-07-30 09:27:20 -07:00
|
|
|
- name: Generate Enum Strings
|
|
|
|
working-directory: ./firmware/
|
2022-08-31 17:43:07 -07:00
|
|
|
run: ./gen_enum_to_string.sh
|
2020-07-30 09:27:20 -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 -- ./controllers/generated/engine_configuration_generated_structures.h
|
2023-01-31 19:26:25 -08:00
|
|
|
git checkout -- ./controllers/generated/rusefi_generated.h
|
2021-12-04 05:17:20 -08:00
|
|
|
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-11-18 15:59:02 -08:00
|
|
|
env:
|
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
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
|
2022-09-18 18:19:42 -07:00
|
|
|
git add 'firmware/*/auto_generated*.cpp'
|
|
|
|
git add 'firmware/*/auto_generated*.h'
|
2022-02-03 11:49:45 -08:00
|
|
|
git add 'firmware/config/boards/*/generated_ts_name_by_pin.cpp'
|
2021-11-10 18:16:55 -08:00
|
|
|
git add java_console/io/src/main/java/com/rusefi/enums
|
2021-12-01 21:20:00 -08:00
|
|
|
git add java_console/models/src/main/java/com/rusefi/config/generated
|
2022-04-29 08:57:48 -07:00
|
|
|
git add *_generated.h
|
2021-03-12 18:47:59 -08:00
|
|
|
# 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
|
2020-06-28 18:25:09 -07:00
|
|
|
git status
|
2020-07-19 14:50:22 -07:00
|
|
|
OUT=$(git commit -am "Auto-generated configs and docs" 2>&1) || echo "commit failed, finding out why"
|
|
|
|
if echo "$OUT" | grep 'nothing to commit'; then
|
2022-04-02 12:14:57 -07:00
|
|
|
echo "headers: looks like nothing to commit"
|
2020-11-18 15:44:53 -08:00
|
|
|
echo "::set-env name=NOCOMMIT::true"
|
2020-07-19 14:50:22 -07:00
|
|
|
exit 0
|
|
|
|
elif echo "$OUT" | grep 'changed'; then
|
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
|
|
|
|
|
|
|
# We need to know what branch this is in order to push to the correct branch
|
|
|
|
- name: Extract branch name
|
|
|
|
shell: bash
|
|
|
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
|
|
|
id: extract_branch
|
|
|
|
|
|
|
|
- name: Push configs
|
2020-07-21 11:34:11 -07:00
|
|
|
if: ${{env.NOCOMMIT != 'true'}}
|
2020-06-18 15:31:54 -07:00
|
|
|
uses: ad-m/github-push-action@master
|
|
|
|
with:
|
|
|
|
github_token: ${{ github.token }}
|
|
|
|
branch: ${{ steps.extract_branch.outputs.branch }}
|
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/
|
2021-11-15 16:44:39 -08:00
|
|
|
run: ASAN_OPTIONS=detect_stack_use_after_return=1 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
|
|
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
|
|
|
|
env:
|
|
|
|
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
|
|
|
|
#
|
|
|
|
# we have minor drama - looks like unit_tests are invoked from root folder while a more natural is to invoke those
|
|
|
|
# from 'unit_tests' folder
|
|
|
|
# as a work-around to leverage unit_tests/.gitignore we move those files into expected folder for now
|
|
|
|
#
|
|
|
|
run: |
|
|
|
|
git config --local user.email "action@github.com"
|
|
|
|
git config --local user.name "GitHub build-unit-tests Action"
|
|
|
|
git status
|
|
|
|
git remote -v
|
|
|
|
echo See https://github.com/rusefi/rusefi/issues/2446
|
|
|
|
git pull https://github.com/rusefi/rusefi master
|
|
|
|
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"
|
|
|
|
if echo "$OUT" | grep -E '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
|
|
|
echo "::set-env name=NOCOMMIT::true"
|
|
|
|
exit 0
|
|
|
|
elif echo "$OUT" | grep 'changed'; then
|
2022-04-02 12:14:57 -07:00
|
|
|
echo "::set-env name=NOCOMMIT::false"
|
|
|
|
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
|
|
|
|
|
|
|
|
- name: Push fresh triggers.txt
|
2022-03-19 18:17:42 -07:00
|
|
|
if: ${{env.NOCOMMIT != 'true'}}
|
2021-07-24 07:20:17 -07:00
|
|
|
uses: ad-m/github-push-action@master
|
|
|
|
with:
|
|
|
|
github_token: ${{ github.token }}
|
2022-03-19 18:17:42 -07:00
|
|
|
branch: ${{ steps.extract_branch.outputs.branch }}
|