mirror of
https://github.com/tj-actions/changed-files
synced 2024-12-21 03:30:38 +00:00
44 lines
1 KiB
YAML
44 lines
1 KiB
YAML
|
name: Matrix Test
|
||
|
|
||
|
on:
|
||
|
workflow_dispatch:
|
||
|
pull_request:
|
||
|
branches:
|
||
|
- main
|
||
|
|
||
|
jobs:
|
||
|
changed-files:
|
||
|
name: Get changes
|
||
|
runs-on: ubuntu-latest
|
||
|
outputs:
|
||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||
|
steps:
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v3
|
||
|
with:
|
||
|
fetch-depth: 0
|
||
|
- name: Get changed files
|
||
|
id: changed-files
|
||
|
uses: ./
|
||
|
with:
|
||
|
json: true
|
||
|
- name: List all changed files
|
||
|
run: echo '${{ steps.changed-files.outputs.all_changed_files }}'
|
||
|
- id: set-matrix
|
||
|
run: echo "matrix={\"container\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT"
|
||
|
|
||
|
matrix-job:
|
||
|
name: Run Matrix Job
|
||
|
runs-on: ubuntu-latest
|
||
|
needs: [changed-files]
|
||
|
strategy:
|
||
|
matrix: ${{ fromJSON(needs.changed-files.outputs.matrix) }}
|
||
|
max-parallel: 4
|
||
|
fail-fast: false
|
||
|
steps:
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v3
|
||
|
- name: Test
|
||
|
run: |
|
||
|
echo ${{ matrix.container }}
|