-
Notifications
You must be signed in to change notification settings - Fork 7
57 lines (52 loc) · 1.58 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
55
56
57
name: Tests
on:
- push
- pull_request
jobs:
build:
strategy:
matrix:
include:
- name: Windows Tests
os: windows-latest
architecture: x64
runs-on: ${{ matrix.os }}
environment: ${{ github.event.inputs.env || 'Development' }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Set up Python
id: setup-py
uses: actions/setup-python@v5
with:
# TODO: Unfreeze python version when this is resolved: https://github.com/actions/setup-python/issues/886
python-version: "3.12"
check-latest: true
cache: "pip" # Cache all pip dependency downloads
- name: Cache venv
id: cache-venv
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ matrix.os }}-tests-venv-${{ steps.setup-py.outputs.python-version }}-${{ hashFiles('**/req*.txt') }}
- name: Create venv
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
python -m venv ./.venv
- name: Activate venv
run: |
source ./.venv/bin/activate || source ./.venv/Scripts/activate
echo $PATH >> $GITHUB_PATH
- name: Install venv dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install -r requirements.txt
- name: Test python formatting
run: black . --check
- name: Run tests
run: |
pytest