Skip to content

Commit

Permalink
fix: use dorny/paths-filter to include/skip a job with a required sta…
Browse files Browse the repository at this point in the history
…tus. (#651)
  • Loading branch information
ericswanson-dfinity authored Jan 29, 2024
1 parent f51565c commit 7074748
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/motoko-counter-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,32 @@ on:
branches:
- master
pull_request:
paths:
- motoko/counter/**
- .github/workflows/provision-darwin.sh
- .github/workflows/provision-linux.sh
- .github/workflows/motoko-counter-example.yaml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# JOB to run change detection
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
sources: ${{ steps.filter.outputs.sources }}
steps:
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
sources:
- motoko/counter/**
- .github/workflows/provision-darwin.sh
- .github/workflows/provision-linux.sh
- .github/workflows/motoko-counter-example.yaml
motoko-counter-example-darwin:
needs: changes
if: ${{ needs.changes.outputs.sources == 'true' }}
runs-on: macos-12
steps:
- uses: actions/checkout@v1
Expand All @@ -26,6 +42,8 @@ jobs:
make test
popd
motoko-counter-example-linux:
needs: changes
if: ${{ needs.changes.outputs.sources == 'true' }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/motoko-counter-skip.yaml

This file was deleted.

0 comments on commit 7074748

Please sign in to comment.