rusefi/.github/workflows/gen-configs.yaml

130 lines
4.4 KiB
YAML
Raw Normal View History

2021-07-24 13:23:03 -07:00
name: Configs & Live Docs
on:
push:
branches:
- master
jobs:
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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
git submodule update --init --depth=1 java_console/peak-can-basic
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
2023-09-25 14:07:35 -07:00
java-version: '11'
- name: Test Compiler
run: javac -version
2020-06-28 18:16:14 -07:00
- name: Install Tools
run: |
2023-02-25 15:07:31 -08:00
sudo bash misc/actions/add-ubuntu-latest-apt-mirrors.sh
sudo apt-get install sshpass sshpass mtools
2020-06-28 18:16:14 -07:00
- name: Configuration Definition and Enum to String CI, without pushing new .jar
working-directory: ./java_tools
run: |
./gradlew :config_definition:shadowJar
./gradlew :config_definition_base:shadowJar
./gradlew :enum_to_string:shadowJar
- name: Generate Live Documentation
working-directory: ./firmware/
2022-08-31 17:43:07 -07:00
run: ./gen_live_documentation.sh
2021-07-30 16:30:12 -07:00
- name: Generate All Configs
working-directory: ./firmware/
Fix #1590 (#1602) * Add checkout * remove empty with statement * Actually we do need push depth * convert gen_upload_docs.bat * convert run.bat * forgot to add run.sh * convert gen_upload_docs.bat * remove checking from bats * change config * fix path * fix path again * fix file extension * remove escapes * added missing quotation and escapes * convert build_current_bundle * convert clean_bootloader * convert compile_bootloader_discovery * convert compile_bootloader * add env var to skip upload * remove checking from compile.bat * working on push.yaml * finish sorting * progress * rename push to builds * rename push to builds * Add skip upload env var * fix pull_request name * fixed typo and changed name * fixed indentation and runs-on * try different env var setup * add nucleos and switch to underscore * add quotes * remove boards that were commented * remove boards that were commented * fix project board name * fixed variable name * add ini-file and console-settings * try installing gcc-multilib first * Install g++-multilib as well * remove unnecessary export * fixed exit numbers * change to different env setup * add simulator and console compilation to board bundles * changed OS and added linux simulator build * add checkout and missing colon * add gcc-multilib installes * Install mingw * fixed install * remove mingw from linux sim and call compile directly * change directory * moved envs to command * debug ls * debug ls * set ftp vars * add makefile debug info * removed batchecks * redirect stdout to easier see orrs * change name * remove redirect, add file inpection * Add conditional project name * Try software upgrade * missing char * update ine files * try quotes * add escapes * add quotes * add escapes and quotes * remove quotes and escapes * remove software upgrade * ignore test 2 * update apt * like this then * forgot import * fix case * remove RUSEFI_SKIP_UPLOAD and check RUSEFI_FTP_SERVER instead * break workflow back apart * upload simulator artifact * fixed operator * update apt * change paths * Update build-firmware.yaml * move update bundle to artifacts * fix var name * Install ncftp * set env vars conditionally * remove check so zips are created * try things the github way and copy to primary * re-enable test * missing space * use bash * use bash * add workflow * add check before upload * install kicad * switch firmware to bash * switch unit_testts to bash * switch jenkins to bash * fix path * pwd * checkout submodules * add ppa for kicad 5.1 * install xvfb and set DISPLAY * use xvfb * use python3 and add NO_DISPLAY var * fetch all * remove blob * undo unintentional changes * reset accidentally commited config.xmlu * remove submodule * fix path * Only call one board * make simulator and console conditional * break away bundle packaging * pass bundle name * switch to bash * make primary bundle conditional * break away packaging for primary and pass config names * Add default name to unit tests * add check to skip config * add property to skip config, and fix check * switch primary bundle to still build * switch to bash * move default config to its own script * add exit 0 * go back to gen_config running all boards * remove TS stuf8f * remove TS stuff * switch to gen_config_board * switch to bash * add kinetis back * add check for kinetis * rename compile_and_upload * add error checking * Revert "add error checking" This reverts commit f6c9b7f2521f9c28ea150da8e733c593a59596a1. * Add readme Co-authored-by: David Holdeman <David Holdeman>
2020-07-14 07:28:26 -07:00
run: bash gen_config.sh
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
- 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
# 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
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"
git add firmware/tunerstudio/generated
2021-08-03 19:52:10 -07:00
git add firmware/controllers/generated
git add 'firmware/*/*generated*.cpp'
git add 'firmware/*/*generated*.h'
git add 'firmware/config/boards/*/generated_ts_name_by_pin.cpp'
git add *.java
2022-04-29 08:57:48 -07:00
git add *_generated.h
git status
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
echo "headers: looks like nothing to commit"
Only run push job if commit found no changes (#1619) * Add checkout * remove empty with statement * Actually we do need push depth * convert gen_upload_docs.bat * convert run.bat * forgot to add run.sh * convert gen_upload_docs.bat * remove checking from bats * change config * fix path * fix path again * fix file extension * remove escapes * added missing quotation and escapes * convert build_current_bundle * convert clean_bootloader * convert compile_bootloader_discovery * convert compile_bootloader * add env var to skip upload * remove checking from compile.bat * working on push.yaml * finish sorting * progress * rename push to builds * rename push to builds * Add skip upload env var * fix pull_request name * fixed typo and changed name * fixed indentation and runs-on * try different env var setup * add nucleos and switch to underscore * add quotes * remove boards that were commented * remove boards that were commented * fix project board name * fixed variable name * add ini-file and console-settings * try installing gcc-multilib first * Install g++-multilib as well * remove unnecessary export * fixed exit numbers * change to different env setup * add simulator and console compilation to board bundles * changed OS and added linux simulator build * add checkout and missing colon * add gcc-multilib installes * Install mingw * fixed install * remove mingw from linux sim and call compile directly * change directory * moved envs to command * debug ls * debug ls * set ftp vars * add makefile debug info * removed batchecks * redirect stdout to easier see orrs * change name * remove redirect, add file inpection * Add conditional project name * Try software upgrade * missing char * update ine files * try quotes * add escapes * add quotes * add escapes and quotes * remove quotes and escapes * remove software upgrade * ignore test 2 * update apt * like this then * forgot import * fix case * remove RUSEFI_SKIP_UPLOAD and check RUSEFI_FTP_SERVER instead * break workflow back apart * upload simulator artifact * fixed operator * update apt * change paths * Update build-firmware.yaml * move update bundle to artifacts * fix var name * Install ncftp * set env vars conditionally * remove check so zips are created * try things the github way and copy to primary * re-enable test * missing space * use bash * use bash * add workflow * add check before upload * install kicad * switch firmware to bash * switch unit_testts to bash * switch jenkins to bash * fix path * pwd * checkout submodules * add ppa for kicad 5.1 * install xvfb and set DISPLAY * use xvfb * use python3 and add NO_DISPLAY var * fetch all * remove blob * undo unintentional changes * reset accidentally commited config.xmlu * remove submodule * fix path * Only call one board * make simulator and console conditional * break away bundle packaging * pass bundle name * switch to bash * make primary bundle conditional * break away packaging for primary and pass config names * Add default name to unit tests * add check to skip config * add property to skip config, and fix check * switch primary bundle to still build * switch to bash * move default config to its own script * add exit 0 * go back to gen_config running all boards * remove TS stuf8f * remove TS stuff * switch to gen_config_board * switch to bash * add kinetis back * add check for kinetis * rename compile_and_upload * add error checking * Revert "add error checking" This reverts commit f6c9b7f2521f9c28ea150da8e733c593a59596a1. * facepalm * pass ini file * set and check env var * add echo * fix syntax errors * fix syntax errors * try quotes Co-authored-by: David Holdeman <David Holdeman>
2020-07-19 14:50:22 -07:00
exit 0
elif echo "$OUT" | grep 'changed'; then
echo "COMMIT=true" >> $GITHUB_ENV
echo "headers: looks like something has changed"
Only run push job if commit found no changes (#1619) * Add checkout * remove empty with statement * Actually we do need push depth * convert gen_upload_docs.bat * convert run.bat * forgot to add run.sh * convert gen_upload_docs.bat * remove checking from bats * change config * fix path * fix path again * fix file extension * remove escapes * added missing quotation and escapes * convert build_current_bundle * convert clean_bootloader * convert compile_bootloader_discovery * convert compile_bootloader * add env var to skip upload * remove checking from compile.bat * working on push.yaml * finish sorting * progress * rename push to builds * rename push to builds * Add skip upload env var * fix pull_request name * fixed typo and changed name * fixed indentation and runs-on * try different env var setup * add nucleos and switch to underscore * add quotes * remove boards that were commented * remove boards that were commented * fix project board name * fixed variable name * add ini-file and console-settings * try installing gcc-multilib first * Install g++-multilib as well * remove unnecessary export * fixed exit numbers * change to different env setup * add simulator and console compilation to board bundles * changed OS and added linux simulator build * add checkout and missing colon * add gcc-multilib installes * Install mingw * fixed install * remove mingw from linux sim and call compile directly * change directory * moved envs to command * debug ls * debug ls * set ftp vars * add makefile debug info * removed batchecks * redirect stdout to easier see orrs * change name * remove redirect, add file inpection * Add conditional project name * Try software upgrade * missing char * update ine files * try quotes * add escapes * add quotes * add escapes and quotes * remove quotes and escapes * remove software upgrade * ignore test 2 * update apt * like this then * forgot import * fix case * remove RUSEFI_SKIP_UPLOAD and check RUSEFI_FTP_SERVER instead * break workflow back apart * upload simulator artifact * fixed operator * update apt * change paths * Update build-firmware.yaml * move update bundle to artifacts * fix var name * Install ncftp * set env vars conditionally * remove check so zips are created * try things the github way and copy to primary * re-enable test * missing space * use bash * use bash * add workflow * add check before upload * install kicad * switch firmware to bash * switch unit_testts to bash * switch jenkins to bash * fix path * pwd * checkout submodules * add ppa for kicad 5.1 * install xvfb and set DISPLAY * use xvfb * use python3 and add NO_DISPLAY var * fetch all * remove blob * undo unintentional changes * reset accidentally commited config.xmlu * remove submodule * fix path * Only call one board * make simulator and console conditional * break away bundle packaging * pass bundle name * switch to bash * make primary bundle conditional * break away packaging for primary and pass config names * Add default name to unit tests * add check to skip config * add property to skip config, and fix check * switch primary bundle to still build * switch to bash * move default config to its own script * add exit 0 * go back to gen_config running all boards * remove TS stuf8f * remove TS stuff * switch to gen_config_board * switch to bash * add kinetis back * add check for kinetis * rename compile_and_upload * add error checking * Revert "add error checking" This reverts commit f6c9b7f2521f9c28ea150da8e733c593a59596a1. * facepalm * pass ini file * set and check env var * add echo * fix syntax errors * fix syntax errors * try quotes Co-authored-by: David Holdeman <David Holdeman>
2020-07-19 14:50:22 -07:00
exit 0
else
echo "headers: looks like something unexpected"
Only run push job if commit found no changes (#1619) * Add checkout * remove empty with statement * Actually we do need push depth * convert gen_upload_docs.bat * convert run.bat * forgot to add run.sh * convert gen_upload_docs.bat * remove checking from bats * change config * fix path * fix path again * fix file extension * remove escapes * added missing quotation and escapes * convert build_current_bundle * convert clean_bootloader * convert compile_bootloader_discovery * convert compile_bootloader * add env var to skip upload * remove checking from compile.bat * working on push.yaml * finish sorting * progress * rename push to builds * rename push to builds * Add skip upload env var * fix pull_request name * fixed typo and changed name * fixed indentation and runs-on * try different env var setup * add nucleos and switch to underscore * add quotes * remove boards that were commented * remove boards that were commented * fix project board name * fixed variable name * add ini-file and console-settings * try installing gcc-multilib first * Install g++-multilib as well * remove unnecessary export * fixed exit numbers * change to different env setup * add simulator and console compilation to board bundles * changed OS and added linux simulator build * add checkout and missing colon * add gcc-multilib installes * Install mingw * fixed install * remove mingw from linux sim and call compile directly * change directory * moved envs to command * debug ls * debug ls * set ftp vars * add makefile debug info * removed batchecks * redirect stdout to easier see orrs * change name * remove redirect, add file inpection * Add conditional project name * Try software upgrade * missing char * update ine files * try quotes * add escapes * add quotes * add escapes and quotes * remove quotes and escapes * remove software upgrade * ignore test 2 * update apt * like this then * forgot import * fix case * remove RUSEFI_SKIP_UPLOAD and check RUSEFI_FTP_SERVER instead * break workflow back apart * upload simulator artifact * fixed operator * update apt * change paths * Update build-firmware.yaml * move update bundle to artifacts * fix var name * Install ncftp * set env vars conditionally * remove check so zips are created * try things the github way and copy to primary * re-enable test * missing space * use bash * use bash * add workflow * add check before upload * install kicad * switch firmware to bash * switch unit_testts to bash * switch jenkins to bash * fix path * pwd * checkout submodules * add ppa for kicad 5.1 * install xvfb and set DISPLAY * use xvfb * use python3 and add NO_DISPLAY var * fetch all * remove blob * undo unintentional changes * reset accidentally commited config.xmlu * remove submodule * fix path * Only call one board * make simulator and console conditional * break away bundle packaging * pass bundle name * switch to bash * make primary bundle conditional * break away packaging for primary and pass config names * Add default name to unit tests * add check to skip config * add property to skip config, and fix check * switch primary bundle to still build * switch to bash * move default config to its own script * add exit 0 * go back to gen_config running all boards * remove TS stuf8f * remove TS stuff * switch to gen_config_board * switch to bash * add kinetis back * add check for kinetis * rename compile_and_upload * add error checking * Revert "add error checking" This reverts commit f6c9b7f2521f9c28ea150da8e733c593a59596a1. * facepalm * pass ini file * set and check env var * add echo * fix syntax errors * fix syntax errors * try quotes Co-authored-by: David Holdeman <David Holdeman>
2020-07-19 14:50:22 -07:00
exit 1
fi
- 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/
run: build/rusefi_test
# 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"
if echo "$OUT" | grep 'nothing to commit\|no changes added'; then
echo "triggers: looks like nothing to commit"
exit 0
elif echo "$OUT" | grep 'changed'; then
echo "COMMIT=true" >> $GITHUB_ENV
echo "triggers: looks like something has changed"
exit 0
else
echo "triggers: looks like something unexpected"
exit 1
fi
- name: Git Pull
if: ${{env.COMMIT == 'true'}}
run: git pull --rebase
- name: Push fresh triggers.txt
if: ${{env.COMMIT == 'true'}}
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ github.ref }}