Skip to content

ReyahSolutions/matrix-git-generator

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A github actions for generating matrix from git changes

Resources

Stars

Watchers

Forks

Packages

No packages published