Skip to content

Commit

Permalink
Add CI workflow for Python tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rocktimsaikia committed Sep 1, 2024
1 parent fcd4928 commit 255562a
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Tests

on:
push:
branches: [main]
paths:
- 'github_dl/**/*.py'
pull_request:
branches: [main]
paths:
- 'github_dl/**/*.py'

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v4
# see details (matrix, python-version, python-version-file, etc.)
# https://github.com/actions/setup-python
- name: Install poetry
uses: abatilo/actions-poetry@v2

- name: Setup a local virtual environment (if no poetry.toml file)
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}

- name: Install dependencies
run: poetry install

- name: Run tests
run: poetry run pytest -v

0 comments on commit 255562a

Please sign in to comment.