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

122 lines
4.3 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@v2
with:
submodules: recursive
fetch-depth: 0
2020-06-28 18:16:14 -07:00
- name: Install Tools
run: sudo apt-get install ncftp 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/
run: bash gen_enum_to_string.sh
- name: Generate 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
2020-06-28 18:16:14 -07:00
- name: Upload .ini files
working-directory: ./firmware/tunerstudio/generated
2020-06-28 18:16:14 -07:00
# run: ./upload.sh ${{ secrets.RUSEFI_DOXYGEN_FTP_USER }} ${{ secrets.RUSEFI_DOXYGEN_FTP_PASS }} ${{ secrets.RUSEFI_FTP_SERVER }}
run: ../upload_ini.sh ${{ secrets.RUSEFI_ONLINE_FTP_USER }} ${{ secrets.RUSEFI_ONLINE_FTP_PASS }} ${{ secrets.RUSEFI_FTP_SERVER }}
2020-06-28 18:16:14 -07:00
- name: Generate Live Documentation
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_live_documentation.sh
# 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'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub build-firmware Action"
git add firmware/tunerstudio/generated
# 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
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
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
echo "::set-env name=NOCOMMIT::true"
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
exit 0
else
exit 1
fi
# 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'}}
uses: ad-m/github-push-action@master
with:
github_token: ${{ github.token }}
branch: ${{ steps.extract_branch.outputs.branch }}
- 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
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
echo "::set-env name=NOCOMMIT::true"
exit 0
elif echo "$OUT" | grep 'changed'; then
exit 0
else
exit 1
fi
- name: Push fresh triggers.txt
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: master