-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (39 loc) · 1.22 KB
/
run_unittests.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Unit Tests
on:
push:
branches: [ "main", "covassist_cleanup" ]
pull_request:
branches: [ "main", "covassist_cleanup" ]
workflow_dispatch:
permissions:
contents: read
jobs:
unittest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5.2.0
with:
python-version: "3.12"
- name: Cache Python virtual environment
uses: actions/cache@v4.0.2
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-python-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-python-
- name: Install Poetry
run: |
python3 -m pip install --upgrade pip
python3 -m pip install poetry
- name: Install dependencies
run: |
poetry install -E test
- name: Run tests
run: |
source $(poetry env info --path)/bin/activate
pytest
working-directory: ./convassist