3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2024-12-17 13:47:20 +00:00
changed-files/.github/workflows/matrix-test.yml
Tonye Jack 05bdc91228
chore: simplify matrix example workflow (#1719)
Co-authored-by: repo-ranger[bot] <39074581+repo-ranger[bot]@users.noreply.github.com>
2023-11-20 03:05:34 +00:00

44 lines
1,001 B
YAML

name: Matrix Test
on:
workflow_dispatch:
pull_request:
branches:
- main
jobs:
changed-files:
name: Get changed files
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.changed-files.outputs.all_changed_files }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: ./
with:
json: true
quotepath: false
escape_json: false
- name: List all changed files
run: echo '${{ steps.changed-files.outputs.all_changed_files }}'
matrix-job:
name: Run Matrix Job
runs-on: ubuntu-latest
needs: [changed-files]
strategy:
matrix:
files: ${{ fromJSON(needs.changed-files.outputs.matrix) }}
max-parallel: 4
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test
run: |
echo ${{ matrix.files }}