Skip to content

Commit

Permalink
adding github actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
cdot65 committed Apr 19, 2024
1 parent 2ac2f0c commit 7597c7c
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/pytests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Python Package

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Run tests
run: |
source .venv/bin/activate
pytest tests/
- name: Run black
run: |
source .venv/bin/activate
black --check --diff .
- name: Run flake8
run: |
source .venv/bin/activate
flake8 . --config=.flake8

0 comments on commit 7597c7c

Please sign in to comment.