-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
90 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
name: Test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
package_name: | ||
description: 'The name of the package to test' | ||
required: true | ||
type: string | ||
tests_path: | ||
description: 'The path to the directory containing pytest tests' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
ruff: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Setup python and restore poetry | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: "pyproject.toml" | ||
cache: "poetry" | ||
|
||
- name: Lint with ruff | ||
run: | | ||
poetry install --with dev | ||
poetry run ruff check ${{ inputs.package_name }} --output-format=github | ||
mypy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Setup python and restore poetry | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: "pyproject.toml" | ||
cache: "poetry" | ||
|
||
- name: Type check with mypy | ||
run: | | ||
poetry install --with dev | ||
poetry run mypy --strict ${{ inputs.package_name }} | ||
pytest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Setup python and restore poetry | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: "pyproject.toml" | ||
cache: "poetry" | ||
|
||
- name: Test with pytest | ||
run: | | ||
poetry install --with dev | ||
poetry run pytest ${{ inputs.tests_path }} | ||
env: | ||
CI: true | ||
TEST_API_KEY: ${{ secrets.TEST_API_KEY }} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
uses: ./.github/workflows/test-reusable.yml | ||
with: | ||
package_name: dvla_vehicle_enquiry_service | ||
tests_path: tests |