-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.26 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
# This workflow is used to run Pytest on every push to the repository.
name: Pytest
on: [push]
# The "pytest" job is responsible for setting up the environment and running Pytest.
jobs:
pytest:
runs-on: ubuntu-latest
steps:
# This step checks out the repository code.
- name: Check out code
uses: actions/checkout@v2
# This step sets up Python 3.x for the job.
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.x'
# This step caches Poetry dependencies to speed up build times and reduce network traffic.
# Caching Poetry dependencies
- name: Cache Poetry dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-poetry-
# This step installs Poetry, which is used for dependency management.
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
# This step installs the project dependencies using Poetry.
- name: Install Dependencies
run: |
poetry install
# This step runs Pytest to execute the tests.
- name: Run Pytest
run: poetry run pytest