-
-
Notifications
You must be signed in to change notification settings - Fork 6
47 lines (44 loc) · 1.37 KB
/
job-lint-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Job - Lint and test
on:
workflow_call:
inputs:
project:
required: true
type: string
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: curl -sSL https://install.python-poetry.org | python -
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "poetry"
- name: Install dependencies
run: poetry install -n --no-ansi
- name: Check black
run: poetry run black --check ${{ inputs.project }}
- name: Check isort
run: poetry run isort ${{ inputs.project }} --profile black --check
- name: Check mypy
run: poetry run mypy --ignore-missing-imports ${{ inputs.project }}
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install poetry
run: curl -sSL https://install.python-poetry.org | python -
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: "poetry"
- name: Install dependencies
run: poetry install -n --no-ansi
- name: Run tests
run: poetry run pytest --cov=${{ inputs.project }} --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3