diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f28c162..4bb878c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,75 +1,52 @@ on: push jobs: - single: + main: runs-on: ubuntu-latest + outputs: + paths: ${{ steps.for-each-4.outputs.paths }} steps: - uses: actions/checkout@v3 + - name: Run colpal/actions-for-each - id: for-each + id: for-each-1 uses: ./ with: patterns: 'fixtures/*' - - run: echo $OUTPUT - env: - OUTPUT: ${{ steps.for-each.outputs.paths }} - - if: steps.for-each.outputs.paths != '["fixtures/function-a/","fixtures/function-b/","fixtures/function-c/","fixtures/run-a/","fixtures/run-b/"]' + - if: steps.for-each-1.outputs.paths != '["fixtures/function-a/","fixtures/function-b/","fixtures/function-c/","fixtures/run-a/","fixtures/run-b/"]' run: exit 1 - multiple-folders: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - name: Run colpal/actions-for-each - id: for-each + id: for-each-2 uses: ./ with: patterns: | fixtures/* !fixtures/*-b - - run: echo $OUTPUT - env: - OUTPUT: ${{ steps.for-each.outputs.paths }} - - if: steps.for-each.outputs.paths != '["fixtures/function-a/","fixtures/function-c/","fixtures/run-a/"]' + - if: steps.for-each-2.outputs.paths != '["fixtures/function-a/","fixtures/function-c/","fixtures/run-a/"]' run: exit 1 - multiple-files: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - name: Run colpal/actions-for-each - id: for-each + id: for-each-3 uses: ./ with: patterns: | fixtures/**/file.txt !fixtures/function-*/** - - run: echo $OUTPUT - env: - OUTPUT: ${{ steps.for-each.outputs.paths }} - - if: steps.for-each.outputs.paths != '["fixtures/run-a/file.txt","fixtures/run-b/file.txt"]' + - if: steps.for-each-3.outputs.paths != '["fixtures/run-a/file.txt","fixtures/run-b/file.txt"]' run: exit 1 - parallel-start: - runs-on: ubuntu-latest - outputs: - paths: ${{ steps.for-each.outputs.paths }} - steps: - - uses: actions/checkout@v3 - name: Run colpal/actions-for-each - id: for-each + id: for-each-4 uses: ./ with: - patterns: 'fixtures/*' - - run: echo $OUTPUT - env: - OUTPUT: ${{ steps.for-each.outputs.paths }} + patterns: 'fixtures/run-*' - parallel-end: - needs: parallel-start + parallel: + needs: main runs-on: ubuntu-latest strategy: matrix: - path: ${{ fromJSON(needs.parallel-start.outputs.paths) }} + path: ${{ fromJSON(needs.main.outputs.paths) }} steps: - uses: actions/checkout@v3 - run: cat ${{ matrix.path }}file.txt