Skip to content

Commit b112c50

Browse files
committed
feat(tests.yml): add GitHub Actions workflow for running tests on push to master branch
chore(.gitignore): remove poetry.lock from gitignore and comment out .idea/ folder ignore
1 parent 391bbc9 commit b112c50

File tree

3 files changed

+316
-3
lines changed

3 files changed

+316
-3
lines changed

.github/workflows/tests.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Run tests
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
tests:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
python-version: ["3.10", "3.11", "3.12"]
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v4
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Install Poetry
20+
uses: abatilo/actions-poetry@v2
21+
- name: Setup a local virtual environment
22+
run: |
23+
poetry config virtualenvs.create true --local
24+
poetry config virtualenvs.in-project true --local
25+
- uses: actions/cache@v3
26+
name: Define a cache for the virtual environment based on the dependencies lock file
27+
with:
28+
path: ./.venv
29+
key: venv-${{ hashFiles('poetry.lock') }}
30+
- name: Install dependencies
31+
run: poetry install
32+
- name: Run tests
33+
run: poetry run pytest

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,4 @@ cython_debug/
159159
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160160
# and can be added to the global gitignore or merged into this file. For a more nuclear
161161
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162-
#.idea/
163-
164-
poetry.lock
162+
#.idea/

0 commit comments

Comments
 (0)