Skip to content

Commit

Permalink
use paths-filter action to figure out changed recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
aryarm authored Mar 2, 2024
1 parent 1b4be5e commit 983d85b
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
get_dirs:
name: Get directory names
runs-on: ubuntu-latest
permissions:
pull-requests: read
strategy:
fail-fast: false
outputs:
Expand All @@ -25,11 +27,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: List changed packages
id: filter
uses: dorny/paths-filter@v3
with:
list-files: shell
filters: |
changed:
- added|modified: 'recipes/**'
- name: get directory names
id: output-dirs
# adapted from https://stackoverflow.com/a/71687652
run: |
matrix=$(cd recipes && ls -d */ | jq --raw-input --slurp --compact-output 'split("/\n")[:-1]')
matrix=$(for i in ${{ steps.filter.outputs.changed_files }}; do sed 's\recipes/\\;s\/.*$\\' <<< $i; done | sort -u | paste -s | jq --raw-input --slurp --compact-output 'split("/\n")[:-1]')
echo "$matrix"
echo "matrix=$matrix" >> $GITHUB_OUTPUT
Expand All @@ -48,13 +59,6 @@ jobs:
- name: Check out the repository
uses: actions/checkout@v4

- name: Confirm package needs to be rebuilt
uses: actions/cache@v4
with:
key:
${{ runner.os }}-${{ runner.arch }}-${{ steps.get-date.outputs.today }}-${{ ${{ recipes/hashFiles(matrix.packagename)/** }}
id: rebuild-cache-check

- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
Expand Down

0 comments on commit 983d85b

Please sign in to comment.