diff --git a/.github/workflows/build-unit-tests.yaml b/.github/workflows/build-unit-tests.yaml index cf69245c0d..7d746e5a8e 100644 --- a/.github/workflows/build-unit-tests.yaml +++ b/.github/workflows/build-unit-tests.yaml @@ -10,6 +10,7 @@ jobs: - uses: actions/checkout@v1 with: submodules: recursive + fetch-depth: 0 - name: Discover cores run: lscpu | egrep 'Model name|Socket|Thread|NUMA|CPU\(s\)' @@ -42,3 +43,31 @@ jobs: - name: Generate Code Coverage working-directory: ./unit_tests/ run: ./ci_gcov.sh ${{ secrets.RUSEFI_DOXYGEN_FTP_USER }} ${{ secrets.RUSEFI_DOXYGEN_FTP_PASS }} ${{ secrets.RUSEFI_FTP_SERVER }} + + # Commit changes and catch the error that occurs if nothing has been changed (without catching other errors) + - name: Commit changes + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub build-unit-tests Action" + git add triggers.txt + git status + OUT=$(git commit -m "Trigger wheel definitions" triggers.txt 2>&1) || echo "commit failed, finding out why" + echo "$OUT" + if echo "$OUT" | grep 'nothing to commit'; then + echo "::set-env name=NOCOMMIT::true" + exit 0 + elif echo "$OUT" | grep 'changed'; then + exit 0 + else + exit 1 + fi + + - name: Push configs + 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 diff --git a/unit_tests/.gitignore b/unit_tests/.gitignore index f6319ed794..e83a1624b1 100644 --- a/unit_tests/.gitignore +++ b/unit_tests/.gitignore @@ -2,5 +2,4 @@ build/ gcov_working_area triggers -triggers.txt *.logicdata