Skip to content

Fix format for parallel job declaration #8

Fix format for parallel job declaration

Fix format for parallel job declaration #8

Workflow file for this run

on: push
jobs:
single:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run colpal/actions-for-each
id: for-each
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/"]'
run: exit 1
multiple-folders:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run colpal/actions-for-each
id: for-each
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/"]'
run: exit 1
multiple-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run colpal/actions-for-each
id: for-each
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"]'
run: exit 1
parallel-start:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run colpal/actions-for-each
id: for-each
uses: ./
with:
patterns: 'fixtures/*'
- run: echo $OUTPUT
env:
OUTPUT: ${{ steps.for-each.outputs.paths }}
parallel-end:
needs: parallel-start
runs-on: ubuntu-latest
strategy:
matrix:
path: ${{ fromJSON(needs.parallel-start.outputs.paths) }}
steps:
- uses: actions/checkout@v3
- run: cat ${{ matrix.path }}file.txt