-
Notifications
You must be signed in to change notification settings - Fork 2
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
411729f
commit db2aba6
Showing
4 changed files
with
25 additions
and
83 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,77 +1,43 @@ | ||
name: Build and test | ||
name: Check and test Python package | ||
|
||
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: | ||
- "3.7" | ||
- "3.8" | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install and check with black, pylint and pontos.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 python, 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 | ||
# 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: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,4 +82,5 @@ profile = "black" | |
line_length = 80 | ||
|
||
[tool.mypy] | ||
files = "autohooks" | ||
ignore_missing_imports = true |