3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2024-12-23 23:25:32 +00:00
changed-files/.github/workflows/matrix-test.yml

45 lines
1 KiB
YAML
Raw Normal View History

2022-12-30 07:03:31 +00:00
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
2023-10-03 00:09:57 +00:00
uses: actions/checkout@v4
2022-12-30 07:03:31 +00:00
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: ./
with:
json: true
quotepath: false
2022-12-30 07:03:31 +00:00
- name: List all changed files
run: echo '${{ steps.changed-files.outputs.all_changed_files }}'
- id: set-matrix
2023-06-22 05:49:05 +00:00
run: echo "matrix={\"files\":${{ steps.changed-files.outputs.all_changed_files }}}" >> "$GITHUB_OUTPUT"
2022-12-30 07:03:31 +00:00
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
2023-10-03 00:09:57 +00:00
uses: actions/checkout@v4
2022-12-30 07:03:31 +00:00
- name: Test
run: |
2023-06-22 05:49:05 +00:00
echo ${{ matrix.files }}