TS: 32bit commands: cleanup and additional checks #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Configs & Live Docs | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| generate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Checkout Submodules Without ChibiOS | |
| run: | | |
| misc/git_scripts/common_submodule_init_without_chibios.sh | |
| - uses: ./.github/actions/setup-java | |
| with: | |
| # using version 21 here just for fun. See build-tsplugin-body.yaml | |
| java-version: '21' | |
| - name: Test Compiler | |
| run: javac -version | |
| - name: Install Tools | |
| run: | | |
| sudo bash misc/actions/add-ubuntu-latest-apt-mirrors.sh | |
| sudo apt-get install sshpass sshpass mtools | |
| - name: Configuration Definition and Enum to String CI, without pushing new .jar | |
| working-directory: . | |
| run: | | |
| ./gradlew jar :config_definition_base:shadowJar :enum_to_string:shadowJar | |
| - name: Generate Live Documentation | |
| working-directory: ./firmware/ | |
| run: ./gen_live_documentation.sh | |
| - name: Generate All Configs | |
| working-directory: ./firmware/ | |
| run: bash gen_config.sh | |
| # # We want to force these files to come from the default "all" config, not the last board generated by gen_config.sh | |
| # # TODO: there is a chance that we can simply remove this invocation? let's try once we fix https://github.com/rusefi/rusefi/issues/7604 | |
| # - name: Reset Default Config Files | |
| # working-directory: ./firmware/ | |
| # run: | | |
| # git checkout -- ../java_console/models/src/main/java/com/rusefi/config/generated/Fields.java | |
| # ./gen_config_default.sh | |
| # Commit changes and catch the error that occurs if nothing has been changed (without catching other errors) | |
| - name: Commit fresh generated headers and TS project | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub gen-configs Action" | |
| # per-board .ini | |
| .github/workflows/bin/smart-git-add.sh 'firmware/tunerstudio/generated/*.ini' 4 | |
| .github/workflows/bin/smart-git-add.sh 'firmware/controllers/generated/rusefi_generated*.h' 2 | |
| .github/workflows/bin/smart-git-add.sh 'firmware/**/*generated*.cpp' | |
| .github/workflows/bin/smart-git-add.sh 'firmware/**/*generated*.h' | |
| .github/workflows/bin/smart-git-add.sh 'firmware/config/boards/*/generated_ts_name_by_pin.cpp' | |
| # misc live data etc. reference files TODO change extention since not really .ini? | |
| .github/workflows/bin/smart-git-add.sh 'firmware/console/binary/generated/*.ini' | |
| .github/workflows/bin/smart-git-add.sh 'firmware/controllers/lua/generated/*.md' | |
| .github/workflows/bin/smart-git-add.sh '**/*.java' | |
| .github/workflows/bin/smart-git-add.sh '*_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" | |
| exit 0 | |
| elif echo "$OUT" | grep 'changed'; then | |
| if [ "${{github.repository}}" == "rusefi/rusefi" ]; then | |
| echo "COMMIT=true" >> $GITHUB_ENV | |
| echo "headers: looks like something has changed, we are on main, so pushing" | |
| else | |
| echo "headers: looks like something has changed, but we are fork" | |
| fi | |
| exit 0 | |
| else | |
| echo "headers: looks like something unexpected" | |
| 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 | |
| .github/workflows/bin/smart-git-add.sh 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 | |
| if [ "${{github.repository}}" == "rusefi/rusefi" ]; then | |
| echo "COMMIT=true" >> $GITHUB_ENV | |
| echo "triggers: looks like something has changed, we are on main, so pushing" | |
| else | |
| echo "triggers: looks like something has changed, but we are fork" | |
| fi | |
| exit 0 | |
| else | |
| echo "triggers: looks like something unexpected" | |
| exit 1 | |
| fi | |
| - name: Quick Rebase | |
| if: ${{env.COMMIT == 'true'}} | |
| run: | | |
| .github/workflows/bin/git-fast-clean-update.sh | |
| - name: Push fresh triggers.txt | |
| if: ${{env.COMMIT == 'true'}} | |
| uses: ad-m/github-push-action@master | |
| with: | |
| github_token: ${{ github.token }} | |
| branch: ${{ github.ref }} |