diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ec01d7a02..d06999db34 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: test: - "test/**" workflows: - - ".github/workflows/build.yml" + - ".github/workflows/**" setup: - "setup.py" - name: autogen has changes @@ -109,3 +109,32 @@ jobs: with: file: ./coverage.xml flags: unittests + build-check: + if: always() + runs-on: ubuntu-latest + needs: [build] + steps: + - name: Get Date + shell: bash + run: | + echo "date=$(date +'%m/%d/%Y %H:%M:%S')" >> "$GITHUB_ENV" + + - name: Run Type is ${{ github.event_name }} + if: ${{ github.event_name != 'schedule' && github.event_name != 'workflow_dispatch'}} + shell: bash + run: | + echo "run_type=${{ github.event_name }}" >> "$GITHUB_ENV" + + - name: Fail workflow if build failed + id: check_build_failed + if: contains(join(needs.*.result, ','), 'failure') + uses: actions/github-script@v6 + with: + script: core.setFailed('Build Failed!') + + - name: Fail workflow if build cancelled + id: check_build_cancelled + if: contains(join(needs.*.result, ','), 'cancelled') + uses: actions/github-script@v6 + with: + script: core.setFailed('Build Cancelled!') diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.yml index 046a5b6d79..1735e71a8f 100644 --- a/.github/workflows/dotnet-build.yml +++ b/.github/workflows/dotnet-build.yml @@ -67,7 +67,7 @@ jobs: defaults: run: working-directory: dotnet - if: success() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dotnet') + if: success() && (github.ref == 'refs/heads/main') needs: build steps: - uses: actions/checkout@v4