Skip to content

Change hoistMatch to respect custom source #39

Change hoistMatch to respect custom source

Change hoistMatch to respect custom source #39

Workflow file for this run

on:
push:
paths:
- '.github/workflows/test.yaml'
- 'dist/main.js'
- 'fixtures/**'
jobs:
main:
runs-on: ubuntu-latest
outputs:
matches: ${{ steps.for-each.outputs.matches }}
steps:
- uses: actions/checkout@v4
- name: Run colpal/actions-for-each
id: for-each-1
uses: ./
with:
patterns: 'fixtures/*'
- if: steps.for-each-1.outputs.matches != '["fixtures/function-a/","fixtures/function-b/","fixtures/function-c/","fixtures/run-a/","fixtures/run-b/"]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each-2
uses: ./
with:
patterns: |
fixtures/*
!fixtures/*-b
- if: steps.for-each-2.outputs.matches != '["fixtures/function-a/","fixtures/function-c/","fixtures/run-a/"]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each-3
uses: ./
with:
patterns: |
fixtures/**/file.txt
!fixtures/function-*/**
- if: steps.for-each-3.outputs.matches != '["fixtures/run-a/file.txt","fixtures/run-b/file.txt"]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each-4
uses: ./
with:
root-patterns: '*/'
filter-patterns: '**/main.*'
- if: steps.for-each-4.outputs.matches != '["dist/"]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each-5
uses: ./
with:
root-patterns: |
./
**/
filter-patterns: '**/main.*'
- if: steps.for-each-5.outputs.matches != '["./","dist/"]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each-6
uses: ./
with:
root-patterns: |
**/*-b/
filter-patterns: '**/file.txt'
- if: steps.for-each-6.outputs.matches != '["fixtures/function-b/","fixtures/run-b/"]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each-7
uses: ./
with:
root-patterns: |
./
filter-patterns: |
**/flie.txt
- if: steps.for-each-7.outputs.matches != '[]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each-8
uses: ./
with:
patterns: |
banana/*
source: '["banana/a.txt","banana/b.txt","apple/a.txt"]'
- if: steps.for-each-8.outputs.matches != '["banana/a.txt","banana/b.txt"]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each-9
uses: ./
with:
patterns: |
**/a.txt
source: '["banana/a.txt","banana/b.txt","apple/a.txt"]'
- if: steps.for-each-9.outputs.matches != '["banana/a.txt","apple/a.txt"]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each-10
uses: ./
with:
root-patterns: |
banana/
apple/
filter-patterns: |
**/b.txt
source: '["banana/a.txt","banana/b.txt","apple/a.txt"]'
- if: steps.for-each-10.outputs.matches != '["banana/"]'
run: exit 1
- name: Run colpal/actions-for-each
id: for-each
uses: ./
with:
patterns: 'fixtures/run-*'
parallel:
needs: main
runs-on: ubuntu-latest
strategy:
matrix:
path: ${{ fromJSON(needs.main.outputs.matches) }}
include:
- path: fixtures/run-a/
value: 4
- path: fixtures/run-b/
value: 5
steps:
- uses: actions/checkout@v4
- run: test "$VALUE" = "$(cat $FILE)"
env:
VALUE: ${{ matrix.value }}
FILE: ${{ matrix.path }}file.txt