From 6de8633065566ff6e696092615473831565df029 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 2 Feb 2021 12:43:11 +0000 Subject: [PATCH] Only run bats diagnostics on failure (#24) * Only run bats diagnostics on failure * Try a different failure syntax * Third time lucky? * Always run if we failed, even though the previous step failed As per https://github.com/actions/runner/issues/491 * Try and fix the logic again * Simplify the testing * Try a different way of checking for failure * Try matching on any status, is matrix confusing things? * Drop the matrix for now * Fix the workflow syntax * Different variable name * Undo the hacking, matrix the bats tests * Actually run bats if we need to * Undo the deliberate test breakage --- .github/workflows/testing.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 697e178..34c4219 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -63,16 +63,22 @@ jobs: diagnose_bats: name: Diagnose bats + needs: test + if: always() && needs.test.result == 'failure' runs-on: ubuntu-latest continue-on-error: true + strategy: + fail-fast: false + matrix: + codespell_pip_version: ['codespell'] + include: + - codespell_pip_version: 'git+https://github.com/codespell-project/codespell.git' steps: - uses: actions/checkout@v1 - name: Set up Python uses: actions/setup-python@v2 - - run: pip3 --quiet --quiet install git+https://github.com/codespell-project/codespell.git + - run: pip3 --quiet --quiet install ${{ matrix.codespell_pip_version }} - run: | - # Skip the bats diagnostics - exit 0 # Simulate the Dockerfile COPY command [ -d "${RUNNER_TEMP}/code/" ] || sudo mkdir -p ${RUNNER_TEMP}/code/ [ -f "${RUNNER_TEMP}/code/codespell-matcher.json" ] || sudo cp codespell-problem-matcher/codespell-matcher.json ${RUNNER_TEMP}/code/