From 42c350775528a8a1f2bcab8d26ead105d9b79db9 Mon Sep 17 00:00:00 2001 From: Ryota Date: Sat, 29 Oct 2022 23:10:27 +0100 Subject: [PATCH 1/3] Add clarification and example for matrix strategy --- .github/workflows/issue-27.yaml | 35 +++++++++++++++++++++++++++++++++ docs/action-usage.md | 6 +++++- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/issue-27.yaml diff --git a/.github/workflows/issue-27.yaml b/.github/workflows/issue-27.yaml new file mode 100644 index 0000000..9e999d2 --- /dev/null +++ b/.github/workflows/issue-27.yaml @@ -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 diff --git a/docs/action-usage.md b/docs/action-usage.md index 2cde7a5..46fe7ad 100644 --- a/docs/action-usage.md +++ b/docs/action-usage.md @@ -35,6 +35,7 @@ curl -sSL https://raw.githubusercontent.com/upsidr/merge-gatekeeper/main/example The below is the copy of [`/example/merge-gatekeeper.yml`](/example/merge-gatekeeper.yml), with extra comments. + ```yaml --- name: Merge Gatekeeper @@ -57,6 +58,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} ``` + @@ -74,4 +76,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. From 5f8aecb0103b18d8df448752082712290770c263 Mon Sep 17 00:00:00 2001 From: Ryota Date: Sat, 29 Oct 2022 23:17:39 +0100 Subject: [PATCH 2/3] Correct with importer update --- docs/action-usage.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/action-usage.md b/docs/action-usage.md index 46fe7ad..e496754 100644 --- a/docs/action-usage.md +++ b/docs/action-usage.md @@ -35,7 +35,6 @@ curl -sSL https://raw.githubusercontent.com/upsidr/merge-gatekeeper/main/example The below is the copy of [`/example/merge-gatekeeper.yml`](/example/merge-gatekeeper.yml), with extra comments. - ```yaml --- name: Merge Gatekeeper @@ -58,7 +57,6 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} ``` - From 68dba02156d29e1962c8d9f53c9abe4c7f63dc54 Mon Sep 17 00:00:00 2001 From: Ryota Date: Sat, 29 Oct 2022 23:51:13 +0100 Subject: [PATCH 3/3] Update importer installation spec --- .github/workflows/documentation-ci.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/documentation-ci.yaml b/.github/workflows/documentation-ci.yaml index cceca78..6f2cd81 100644 --- a/.github/workflows/documentation-ci.yaml +++ b/.github/workflows/documentation-ci.yaml @@ -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 {} \;