diff --git a/.github/workflows/ci-builtin.yml b/.github/workflows/ci-builtin.yml index 571a777..8ec78fd 100644 --- a/.github/workflows/ci-builtin.yml +++ b/.github/workflows/ci-builtin.yml @@ -1,4 +1,4 @@ -name: '2.1. ๐Ÿ” CI (built-in matrix)' +name: '๐Ÿ” CI (built-in matrix)' on: push diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a53fbc5..daffb5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: '2.2. ๐Ÿ” CI' +name: '๐Ÿ” CI' on: push diff --git a/.github/workflows/basic-usage.yml b/.github/workflows/quickstart.yml similarity index 90% rename from .github/workflows/basic-usage.yml rename to .github/workflows/quickstart.yml index 8b83043..ad1372b 100644 --- a/.github/workflows/basic-usage.yml +++ b/.github/workflows/quickstart.yml @@ -1,4 +1,4 @@ -name: '1. โฑ๏ธ Basic usage' +name: 'โฑ๏ธ Quickstart' on: push: @@ -6,6 +6,8 @@ on: - cron: '0 6 * * *' workflow_dispatch: +# This is action integration test and quickstart example at the same time. + jobs: # Setup matrix setup-matrix: diff --git a/.github/workflows/test-builtin.yml b/.github/workflows/test-builtin.yml index e2a8b03..5c717c3 100644 --- a/.github/workflows/test-builtin.yml +++ b/.github/workflows/test-builtin.yml @@ -1,4 +1,4 @@ -name: '3.1. ๐Ÿงช Test (built-in matrix)' +name: '๐Ÿงช Test (built-in matrix)' on: push diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5e0d6f1..393ed26 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,10 @@ -name: '3.2. ๐Ÿงช Test' +name: '๐Ÿงช Test' -on: push +on: + push: + schedule: + - cron: '0 6 * * *' + workflow_dispatch: # This is action code test, action integration test and advanced usage example # at the same time. diff --git a/README.md b/README.md index ac9387a..d18a126 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Setup matrix +# โœ‰๏ธ Setup matrix GitHub action to create reusable dynamic job matrices for your workflows. @@ -12,7 +12,7 @@ as possible and thus allow you a smooth transition in your workflow. All given examples can be found as GitHub workflows in [this repository](https://github.com/druzsan/test-setup-matrix). -## Basic usage +## Quickstart ```yaml jobs: @@ -23,22 +23,29 @@ jobs: matrix: ${{ steps.setup-matrix.outputs.matrix }} steps: - id: setup-matrix - uses: druzsan/setup-matrix@v1 + uses: druzsan/setup-matrix@v2 with: matrix: | - os: ubuntu-latest windows-latest macos-latest, - python-version: 3.8 3.9 3.10 + fruit: [apple, pear] + animal: [quick red fox, lazy dog] + include: + - color: green + - color: pink + animal: quick red fox + - color: brown + animal: cat + exclude: + - fruit: apple + animal: lazy dog # Setup python and print version - setup-python: + echo: needs: setup-matrix strategy: matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }} - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - - uses: actions/setup-python@v5 - with: - python-version: '${{ matrix.python-version }}' - - run: python --version + - run: | + echo "fruit: ${{ matrix.fruit }}, animal: ${{ matrix.fruit }}, color: ${{ matrix.color }}" ``` For more examples, see [advanced usage](#advanced-usage) @@ -58,10 +65,13 @@ recommended to use (any) YAML multiline strings to unclutter your inputs, e.g.: ```yaml with: matrix: | - node-version: 12 14 16 - include: | - node-version: 16 - npm: 6 + os: [ubuntu-latest] + python-version: [3.8, 3.10, 3.12] + include: + - os: windows-latest + python-version: 3.8 + - os: macos-latest + python-version: 3.8 ``` All words themselves must not contain any whitespaces, colons and commas. All