Skip to content

Commit

Permalink
Change: Use reusable workflows for testing and type checking
Browse files Browse the repository at this point in the history
Use as much as common workflows as possible.
  • Loading branch information
bjoernricks committed May 17, 2023
1 parent c4a8d53 commit 72644a5
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ jobs:
uses: greenbone/actions/poetry@v2
with:
python-version: ${{ matrix.python-version }}
cache: true
cache: "true"
- name: Check with black
run: poetry run black --check --diff autohooks
- name: Check with flake8
run: poetry run flake8 autohooks

type-checking:
name: Type-checker
runs-on: 'ubuntu-latest'
strategy:
matrix:
python-version:
Expand All @@ -41,16 +40,12 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: greenbone/actions/mypy-python@v2
with:
python-version: ${{ matrix.python-version }}
uses: greenbone/workflows/.github/workflows/typing-python.yml@main
with:
python-version: ${{ matrix.python-version }}

test:
name: Run all tests
runs-on: 'ubuntu-latest'
strategy:
matrix:
python-version:
Expand All @@ -59,14 +54,9 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v3
- name: Install poetry and dependencies
uses: greenbone/actions/poetry@v2
with:
python-version: ${{ matrix.python-version }}
- name: Run unit tests
run: poetry run python -m unittest
uses: greenbone/workflows/.github/workflows/test-python.yml@main
with:
python-version: ${{ matrix.python-version }}

codecov:
name: Upload coverage to codecov.io
Expand All @@ -78,3 +68,7 @@ jobs:
uses: greenbone/actions/coverage-python@v2
with:
python-version: "3.10"

check-version:
name: Check versioning for consistency
uses: greenbone/workflows/.github/workflows/check-version.yml@main

0 comments on commit 72644a5

Please sign in to comment.