-
Notifications
You must be signed in to change notification settings - Fork 84
59 lines (49 loc) · 1.46 KB
/
pytest.yml
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
name: Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
pytest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, 3.11]
poetry-version: [1.3.2]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Cache poetry installation
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-${{ matrix.python-version }}-${{ matrix.poetry-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
poetry-version: ${{ matrix.poetry-version }}
virtualenvs-create: true
virtualenvs-in-project: true
- name: Cache dependencies
uses: actions/cache@v2
with:
path: .venv
key: pydeps-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: poetry install --with test --no-interaction --no-root
if: steps.cache-deps.outputs.cache-hit != 'true'
- name: Install AutoPR
run: poetry install --no-interaction
- name: Configure git credentials
run: |
git config --global user.email "autopr@irgolic.com"
git config --global user.name "AutoPR"
- name: Run pytest
run: poetry run pytest