-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change: Use generic reusable workflows
Use our new generic reusable workflows where possible.
- Loading branch information
1 parent
7a91599
commit 0592dd4
Showing
4 changed files
with
30 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,43 @@ | ||
name: Build and test Python package | ||
name: Check and test Python project | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: | ||
- main | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
linting: | ||
name: Linting | ||
runs-on: 'ubuntu-latest' | ||
lint-and-test: | ||
strategy: | ||
matrix: | ||
python-version: | ||
matrix: | ||
python-version: | ||
- "3.7" | ||
- "3.8" | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: greenbone/actions/lint-python@v2 | ||
with: | ||
packages: autohooks tests | ||
python-version: ${{ matrix.python-version }} | ||
type-checking: | ||
name: Type-checker | ||
runs-on: 'ubuntu-latest' | ||
strategy: | ||
matrix: | ||
python-version: | ||
- "3.7" | ||
- "3.8" | ||
- "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: | ||
packages: autohooks | ||
python-version: ${{ matrix.python-version }} | ||
test: | ||
name: Run all tests | ||
runs-on: 'ubuntu-latest' | ||
strategy: | ||
matrix: | ||
python-version: | ||
- "3.7" | ||
- "3.8" | ||
- "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 | ||
|
||
name: Check and test | ||
uses: greenbone/workflows/.github/workflows/ci-python.yml@main | ||
with: | ||
lint-packages: autohooks tests | ||
python-version: ${{ matrix.python-version }} | ||
|
||
|
||
codecov: | ||
name: Upload coverage to codecov.io | ||
needs: test | ||
runs-on: 'ubuntu-latest' | ||
# run action directly because GitHub has an internal error when using our | ||
# generic reusable workflow | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Calculate and upload coverage to codecov.io | ||
- name: Install and calculate and upload coverage to codecov.io | ||
uses: greenbone/actions/coverage-python@v2 | ||
with: | ||
python-version: "3.10" | ||
cache: "true" | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
versioning: | ||
name: Check versioning | ||
uses: greenbone/workflows/.github/workflows/check-version.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters