From 2f9ee793f0c70ff058e29859c5f62ba80770b688 Mon Sep 17 00:00:00 2001 From: Joe Rickerby Date: Wed, 4 Nov 2020 11:38:03 +0000 Subject: [PATCH] Adjust sample build to show passing/failing test Drop the 'allow fail' approach, it shows up as red in PR/commit status --- .github/workflows/sample_build.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/sample_build.yml b/.github/workflows/sample_build.yml index 99791631..6dc8de88 100644 --- a/.github/workflows/sample_build.yml +++ b/.github/workflows/sample_build.yml @@ -4,17 +4,11 @@ on: [push, pull_request] jobs: build_wheels: - name: Build wheels [${{ matrix.result }}] + name: Sample build [${{ matrix.result }}] runs-on: ubuntu-18.04 - continue-on-error: ${{ matrix.allow_fail }} strategy: - fail-fast: false matrix: - include: - - result: success - allow_fail: false - - result: failure - allow_fail: true + result: [success, failure] steps: - uses: actions/checkout@v2 @@ -30,7 +24,7 @@ jobs: - name: Generate sample project run: | - python -m test.test_projects test.test_0_basic.basic_project sample_project + python -m test.test_projects test.test_testing.project_with_a_test sample_project - name: Build wheels if: matrix.result == 'success' @@ -42,6 +36,10 @@ jobs: if: matrix.result == 'failure' run: | cd sample_project - # sabotage the project to cause an error - echo '>' >> setup.py - python -m cibuildwheel --output-dir wheelhouse + # adjust the project to cause an error + echo ' + class AnotherTest: + def test_something(self): + self.fail("sabotage!") + ' >> test/spam_test.py + python -m cibuildwheel --output-dir wheelhouse || true