Use custom script to check for build failures (#10968)

Motivation:

It turns out we can't use the action to check for build failures as it can't be used when a PR is done from a fork. Let's just use our simple script.

Modifications:

- Replace action with custom script

Result:

Builds for PRs that are done via forks work again.
This commit is contained in:
Norman Maurer 2021-01-27 12:02:24 +01:00 committed by GitHub
parent b743e3ab42
commit 147ccb6213
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 9 deletions

15
.github/scripts/check_build_result.sh vendored Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
set -e
if [ "$#" -ne 1 ]; then
echo "Expected build log as argument"
exit 1
fi
if grep -q 'BUILD FAILURE' $1 ; then
echo "Build failure detected, please inspect build log"
exit 1
else
echo "Build successful"
exit 0
fi

View File

@ -47,12 +47,10 @@ jobs:
run: docker-compose ${{ matrix.docker-compose-build }}
- name: Build project without leak detection
run: docker-compose ${{ matrix.docker-compose-run }}
run: docker-compose ${{ matrix.docker-compose-run }} | tee build.output
- name: ${{ matrix.setup }} test-report
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checking for test failures
run: ./.github/scripts/check_build_result.sh build.output
- uses: actions/upload-artifact@v2
if: ${{ failure() }}

View File

@ -121,10 +121,8 @@ jobs:
- name: Build project with leak detection
run: docker-compose ${{ matrix.docker-compose-run }} | tee build-leak.output
- name: ${{ matrix.setup }} test-report
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checking for test failures
run: ./.github/scripts/check_build_result.sh build-leak.output
- name: Checking for detected leak
run: ./.github/scripts/check_leak.sh build-leak.output