Skip to content

Add clarification and example for matrix strategy #44

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/documentation-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@ jobs:
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: ">=1.18.0"
check-latest: true
- name: Install Importer
run: brew install upsidr/tap/importer
run: go install github.com/upsidr/importer/cmd/importer@v0.1.4

- name: Run Importer against all *.md files
run: find . -name '*.md' -exec importer update {} \;
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/issue-27.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
name: Matrix Test

on:
push:
branches:
- main

jobs:
matrix-test:
runs-on: ubuntu-latest
strategy:
matrix:
m-abc:
- "a"
- "b"
- "c"
- "d"
- "e"
m-xyz:
- "x"
- "y"
- "z"
fail-fast: false
steps:
- run: |
echo "Running matrix based test"
echo
echo " m-abc: ${{ matrix.m-abc }}"
echo " m-xyz: ${{ matrix.m-xyz }}"

# Below is for testing failure handling. Commented out for this.

# Force fail if input is "a" and "z"
# if [[ ${{ matrix.m-abc }} == "a" && ${{ matrix.m-xyz }} == "z" ]]; then return 1; fi
4 changes: 3 additions & 1 deletion docs/action-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,6 @@ Create a YAML file with just a single Importer Marker:

With that, you can simply run `importer update FILENAME` to get the latest spec. You can also update the file used to specific branch or version.

###
### Use with matrix strategy

Merge Gatekeeper supports the use of matrix strategy. If any of the job fails, Merge Gatekeeper will also fail. In case of a complex matrix setup where one entry is not going to be needed, you may need to tweak Merge Gatekeeper spec to ignore some errors.