Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork1
🧪 💥 GitHub action that creates a non-square matrix parsing a readable config.
License
fabiocaccamo/create-matrix-action
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
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.
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-versionanddatabaseare just the matrix variable names that we can access in the following step, so it is possible to name these variables as needed.
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.
Released underMIT License.
About
🧪 💥 GitHub action that creates a non-square matrix parsing a readable config.
Topics
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.