-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.53 KB
/
test-python-library.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
name: "test-python-library"
on: push
jobs:
test:
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python 3.9.16
uses: actions/setup-python@v4
with:
python-version: 3.9.16
# try to load cached venv
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-3.9.16-${{ hashFiles('poetry.lock') }}
# install & configure poetry if cache does not exist
- name: Install Poetry
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
version: 1.5.1
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
# install dependencies if cache does not exist
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --with=dev
shell: bash
# run tests
- name: Run pytests
env:
GITHUB_REPOSITORY: ${{ github.action_repository }}
GITHUB_ACCESS_TOKEN: ${{ github.token }}
run: .venv/bin/python -m pytest tests/ -m "ci"
shell: bash