Skip to content

Commit

Permalink
Merge pull request #16 from Tranquility2/workflow_improve
Browse files Browse the repository at this point in the history
Updated all workflow for better reuse
  • Loading branch information
Tranquility2 authored Apr 23, 2024
2 parents b5d8935 + efa9cd0 commit 9f10d3e
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 15 deletions.
22 changes: 17 additions & 5 deletions .github/actions/prepare-environment/action.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,28 @@
name: "Prepare Environment"
description: "Prepare the development environment for the other actions"
inputs:
python-version:
type: string
description: "The Python version to use"
required: true
default: 3.11
setup-type:
type: choice
description: "The type of setup to use"
required: true
options:
- dev
- test

runs:
using: "composite"
steps:
- name: Setup Python
uses: actions/setup-python@v4
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: 3.11

python-version: ${{ inputs.python-version }}
- name: Install Dev Dependencies
shell: bash
run: |
python -m pip install --upgrade pip
make setup-dev
make setup-${{ inputs.setup-type }}
3 changes: 3 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
- uses: actions/checkout@v4
- name: Prepare Environment
uses: ./.github/actions/prepare-environment
with:
python-version: 3.11
setup-type: dev
- name: Validate using Black
run: |
make check-black
9 changes: 5 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
make setup-test
- name: Prepare Environment
uses: ./.github/actions/prepare-environment
with:
python-version: 3.11
setup-type: test
- name: Check code coverage
run: |
make coverage
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/isort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
- uses: actions/checkout@v4
- name: Prepare Environment
uses: ./.github/actions/prepare-environment
with:
python-version: 3.11
setup-type: dev
- name: Validate using Isort
run: |
make check-isort
3 changes: 3 additions & 0 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
- uses: actions/checkout@v4
- name: Prepare Environment
uses: ./.github/actions/prepare-environment
with:
python-version: 3.11
setup-type: dev
- name: Analysing the code with Mypy
run: |
make check-mypy
3 changes: 3 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
- uses: actions/checkout@v4
- name: Prepare Environment
uses: ./.github/actions/prepare-environment
with:
python-version: 3.11
setup-type: dev
- name: Analysing the code with pylint
run: |
make check-lint
9 changes: 3 additions & 6 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ jobs:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Prepare Environment
uses: ./.github/actions/prepare-environment
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
make setup-test
setup-type: test
- name: Checking using Pytest
run: |
make pytest

0 comments on commit 9f10d3e

Please sign in to comment.