Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the Docs #2

Open
KyleJamesWalker opened this issue Jun 29, 2022 · 0 comments
Open

Improve the Docs #2

KyleJamesWalker opened this issue Jun 29, 2022 · 0 comments

Comments

@KyleJamesWalker
Copy link
Owner

KyleJamesWalker commented Jun 29, 2022

I need to improve the docs, with a sample repo like the following:

Folder structure:

.
├── Makefile
├── README.md
├── example-1
│   └── README.md
└── example-2
    └── README.md

Example workflow:

name: Test PR

on:
  pull_request:
    types: [edited, opened, synchronize, reopened]
    branches: [master]

jobs:

  pr-changes:
    runs-on: ubuntu-latest

    outputs:
      matrix-params: ${{ steps.matrix-builder.outputs.matrix }}
      matrix-populated: ${{ steps.matrix-builder.outputs.matrix-populated }}

    steps:
      - name: PR Changes Matrix Builder
        uses: KyleJamesWalker/pr-changes-matrix-builder@v0.0.1
        id: matrix-builder
        with:
          inject_primary_key: project_name
          extract_re: '(?P<project_name>.*)/.*'
          # Only changes in folders, nothing in the root should be included
          paths_include: '["**/**"]'
          paths_ignore: '[".github/**"]'

  test-pr:
    needs: [pr-changes]
    if: needs.pr-changes.outputs.matrix-populated == 'true'
    runs-on: ubuntu-latest

    strategy:
      matrix:
        params: ${{ fromJson(needs.pr-changes.outputs.matrix-params ) }}

    steps:
      - uses: actions/checkout@v2

      - name: Test
        run: make test project_name=${{ matrix.params.project_name }}

Example Makefile:

protocol ?= unset

test:
	@echo Testing protocol = ${protocol}

This will run make test protocl=xxx for each folder that has changes in it, but it will also ignore changes in the .github and root folers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant