Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Create Matrix Action

Actions
This action creates a non-square matrix from an input string
v5
Latest
Star (12)

create-matrix-action

This action creates a non-square matrix from parsing a matrix configuration declared in the workflow file.

I wrote this action for my python/django testing needs, but it is very flexible and scalable, so it can be used in many other contexts.

Matrix configuration

Example:

python-version {3.10}, django-version {4.0, 4.1, 4.2, 5.0, 5.1}, database {sqlite, mysql, postgres}python-version {3.11}, django-version {4.1, 4.2, 5.0, 5.1}, database {sqlite, mysql, postgres}python-version {3.12}, django-version {4.2, 5.0, 5.1}, database {sqlite, mysql, postgres}python-version {3.13}, django-version {5.1}, database {sqlite, mysql, postgres}

Note:In the above example,python-version,django-version anddatabase are just the matrix variable names that we can access in the following step, so it is possible to name these variables as needed.

Workflow

Example:

# ...jobs:prepare:runs-on:ubuntu-lateststeps:      -name:Checkout codeuses:actions/checkout@v2      -name:Create matrixid:create_matrixuses:fabiocaccamo/create-matrix-action@v3with:matrix:|            python-version {3.10}, django-version {4.0, 4.1, 4.2, 5.0, 5.1}, database {sqlite, mysql, postgres}            python-version {3.11}, django-version {4.1, 4.2, 5.0, 5.1}, database {sqlite, mysql, postgres}            python-version {3.12}, django-version {4.2, 5.0, 5.1}, database {sqlite, mysql, postgres}            python-version {3.13}, django-version {5.1}, database {sqlite, mysql, postgres}outputs:matrix:${{ steps.create_matrix.outputs.matrix }}test:needs:prepareruns-on:ubuntu-lateststrategy:fail-fast:falsematrix:include:${{fromJson(needs.prepare.outputs.matrix)}}# ...steps:# ...      -name:Debug matrixrun:|          echo "Python ${{ matrix.python-version }} + Django ${{ matrix.django-version }} + Database ${{ matrix.database }}"

Check the fulltest-action.yaml workflow file.


License

Released underMIT License.

Create Matrix Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

This action creates a non-square matrix from an input string
v5
Latest

Create Matrix Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.


[8]ページ先頭

©2009-2025 Movatter.jp