Skip to content

Commit

Permalink
merge new check-for-skip job into setup job
Browse files Browse the repository at this point in the history
Since the check-for-skip work needs pretty much the same setup as the
setup job, merge the two and avoid the extra job.
  • Loading branch information
lread committed Jul 30, 2024
1 parent 4e68d98 commit 682e159
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,11 @@ on:
- master

jobs:
check-for-skip:
runs-on: ubuntu-latest
outputs:
skip_tests: ${{ steps.check_for_skip.outputs.skip_tests }}
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Babashka
uses: DeLaGuardo/[email protected]
with:
bb: 'latest'

- name: Check if Tests Should Run
id: check_for_skip
run: bb -ci-set-skip-tests

setup:
needs: check-for-skip
runs-on: ubuntu-latest
if: needs.check-for-skip.outputs.skip_tests == 'false'

outputs:
skip_tests: ${{ steps.check_for_skip.outputs.skip_tests }}
tests: ${{ steps.set-tests.outputs.tests }}

steps:
Expand Down Expand Up @@ -64,14 +46,20 @@ jobs:
- name: Bring down deps
run: bb download-deps

- name: Check if Tests Should Run
id: check_for_skip
run: bb -ci-set-skip-tests

- id: set-tests
if: steps.check_for_skip.skip_tests = 'false'
name: Set test var for matrix
# run test.clj directly instead of via bb task to avoid generic task output
run: echo "tests=$(bb script/test_matrix.clj --format json)" >> $GITHUB_OUTPUT

build:
needs: setup
runs-on: ${{ matrix.os }}-latest
if: needs.setup.outputs.skip_tests == 'false'
strategy:
fail-fast: false
matrix:
Expand Down

0 comments on commit 682e159

Please sign in to comment.