Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
npv2k1 committed Feb 2, 2024
1 parent da5f924 commit b78a02e
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions .github/workflows/test-dev-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,21 @@ on: # rebuild any PRs and main branch changes
- develop

jobs:
find-jobs:
name: Find Jobs
directories: # Job that list subdirectories
runs-on: ubuntu-latest
outputs:
folders: ${{ steps.jobs.outputs.folders }}
dir: ${{ steps.set-dirs.outputs.dir }} # generate output name dir by using inner step output
steps:
- uses: actions/checkout@v1

- id: jobs
uses: philips-labs/list-folder-action@v1
with:
path: ./templates

matrix:
name: Matrix Jobs
- uses: actions/checkout@v2
- id: set-dirs # Give it an id to handle to get step outputs in the outputs key above
run: echo "::set-output name=dir::$(ls -d */ | jq -R -s -c 'split("\n")[:-1]')"
# Define step output named dir base on ls command transformed to JSON thanks to jq
loop:
runs-on: ubuntu-latest
needs: [find-jobs]
defaults:
run:
working-directory: ${{ matrix.folder }}
needs: [directories] # Depends on previous job
strategy:
matrix:
folder: ${{ fromJson(needs.find-jobs.outputs.folders )}}
dir: ${{fromJson(needs.directories.outputs.dir)}} # List matrix strategy from directories dynamically
steps:
- name: do something
run: echo ${{ matrix.folder }}
- run: echo ${{matrix.dir}}

0 comments on commit b78a02e

Please sign in to comment.