Skip to content

Matrix Git generator

Actions
A github action that can generate a matrix to run multiple jobs from git changes
v1
LatestPre-release
Star (4)

Matrix Git generator

With this github actions you can generate a matrix to run multiple jobs from git changes

This github actions has been designed to be used in monorepo where you want to execute jobs for specific folder changes.

Example

name: A simple demonstration
on: push

jobs:
  generate_matrix:
    name: Find services
    runs-on: ubuntu-latest
    outputs:
      matrix: "{\"path\": ${{ steps.generate_matrix.outputs.matrix }} }"
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Generate matrix
        id: generate_matrix
        uses: ReyahSolutions/matrix-git-generator@v1
        with:
          filters: |
            service.*/**

  test_service:
    name: Test service
    runs-on: ubuntu-latest
    needs: [generate_matrix]
    strategy:
      matrix: ${{fromJson(needs.generate_matrix.outputs.matrix)}}
      fail-fast: true 
    steps:
      # [...] Do what ever you want for each match
      - name: Example
        run: |
          cd ${{ matrix.path }}
          make test

Matrix Git generator is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

A github action that can generate a matrix to run multiple jobs from git changes
v1
LatestPre-release

Matrix Git generator is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.