generated from beneisner/python_pkg_template
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (34 loc) · 973 Bytes
/
run-tests.yaml
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
name: Run Tests
on:
workflow_call:
inputs:
install_string:
required: True
type: string
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
##############################################
# Skip caching if using a local runner.
- uses: actions/setup-python@v4
if: ${{ !env.ACT }}
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: "pyproject.toml"
- uses: actions/setup-python@v4
if: ${{ env.ACT }}
with:
python-version: '3.10'
##############################################
- name: Install package
run: pip install "${{ inputs.install_string }}"
- name: Code Quality
run: python -m black src/ tests/ --check
- name: MyPy Typechecking
run: python -m mypy src/ tests/
# Run tests.
- name: Test with pytest
run: python -m pytest