-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (49 loc) · 1.37 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
name: tests
env:
GIT_MAIN_BRANCH: "main"
# Controls when the workflow will run.
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
jobs:
lint_and_typecheck:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Cancel previous
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
if: ${{github.ref != 'refs/head/main'}}
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- uses: pre-commit/action@v3.0.0
unit_tests:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Cancel previous
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
if: ${{github.ref != 'refs/head/main'}}
- uses: actions/checkout@v3
- name: Update pip
id: pip-cache
run: |
python3 -m pip install --upgrade pip
- name: Local install & test requirements
run: |
pip3 install -e ./
pip3 install -r ./test-requirements.txt
# Run repository unit tests.
- name: Run unit tests
run: |
pytest --tb=short -v --log-cli-level=INFO ./