Skip to content

Commit

Permalink
Merge pull request #2 from druzsan/feature/build-matrix
Browse files Browse the repository at this point in the history
Feature/build matrix
  • Loading branch information
druzsan authored Apr 25, 2023
2 parents 4c001d7 + d9d7771 commit 6e53204
Show file tree
Hide file tree
Showing 6 changed files with 573 additions and 5 deletions.
88 changes: 87 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,99 @@
name: CI
on: push
jobs:
# # No build matrix stage
# setup-python:
# strategy:
# matrix:
# os: [ubuntu-latest]
# python-version: ['3.8', '3.9', '3.10']
# runs-on: ${{ matrix.os }}
# steps:
# - run: |
# echo "black" >> requirements.txt
# echo "pylint" >> requirements.txt
# echo "pytest" >> requirements.txt
# - uses: actions/setup-python@v4
# with:
# python-version: '${{ matrix.python-version }}'
# cache: pip
# - run: python --version
# - run: python -m pip install -r requirements.txt
# - run: python -m pip list
# check-code:
# needs: setup-python
# strategy:
# matrix:
# os: [ubuntu-latest]
# python-version: ['3.8', '3.9', '3.10']
# runs-on: ${{ matrix.os }}
# steps:
# - run: |
# echo "black" >> requirements.txt
# echo "pylint" >> requirements.txt
# echo "pytest" >> requirements.txt
# - uses: actions/setup-python@v4
# with:
# python-version: '${{ matrix.python-version }}'
# cache: pip
# - run: python -m pip install -r requirements.txt
# - run: black --check .
# - run: pylint .
# unit-test:
# needs: setup-python
# strategy:
# matrix:
# os: [ubuntu-latest]
# python-version: ['3.8', '3.9', '3.10']
# runs-on: ${{ matrix.os }}
# steps:
# - run: |
# echo "black" >> requirements.txt
# echo "pylint" >> requirements.txt
# echo "pytest" >> requirements.txt
# - uses: actions/setup-python@v4
# with:
# python-version: '${{ matrix.python-version }}'
# cache: pip
# - run: python -m pip install -r requirements.txt
# - run: pytest

build-matrix:
name: '🧱 Build matrix'
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.build-matrix.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: '🧱 Build matrix'
id: build-matrix
uses: ./
- run: echo "${{ steps.build-matrix.outputs.matrix }}"
with:
matrix: |
os: ubuntu-latest windows-latest macos-latest,
node-version: 16 18,
python-version: 3.6 3.8 3.10 3.12
test-matrix:
name: '🧪 Test matrix'
needs:
- build-matrix
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.build-matrix.outputs.matrix) }}
runs-on: ubuntu-latest
steps:
- name: '📢 Echo matrix combination'
run: |
echo "${{ matrix.os }}"
echo "${{ matrix.node-version }}"
echo "${{ matrix.python-version }}"
# debug-matrix:
# strategy:
# matrix:
# foo: [a, b, c]
# bar: [a, b, a]
# runs-on: ubuntu-latest
# steps:
# - run: echo "a=${{ matrix.a }}, b=${{ matrix.b }}"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode/
.idea/
.direnv/
.dev/
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ repos:
- id: check-added-large-files
- id: check-merge-conflict
- id: check-yaml
- id: check-executables-have-shebangs

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
Expand All @@ -20,3 +22,8 @@ repos:
hooks:
- id: check-github-actions
- id: check-github-workflows
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: shellcheck
- id: shfmt
Loading

0 comments on commit 6e53204

Please sign in to comment.