-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (51 loc) · 1.54 KB
/
pull.yml
File metadata and controls
62 lines (51 loc) · 1.54 KB
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
58
59
60
61
62
name: Pull workflow
on:
pull_request:
branches:
- 'develop'
- 'main'
jobs:
run-tests:
if: true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 'latest'
- name: Setup local venv
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
poetry run python --version
- name: Restore dependencies
id: restore-dependencies
uses: actions/cache/restore@v4
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
if: steps.restore-dependencies.outputs.cache-hit != 'true'
run: poetry install -vvv
- name: Cache dependencies
uses: actions/cache/save@v4
with:
path: ./.venv
key: ${{ steps.restore-dependencies.outputs.cache-primary-key }}
- name: Install project
run: poetry install --only-root
- name: Run tests
run: poetry run pytest --junitxml=junit/test-results.xml
- name: Publish test report
uses: mikepenz/action-junit-report@v5
if: always()
with:
report_paths: 'junit/test-results.xml'