Skip to content

Commit

Permalink
ci: add github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wfscheper committed Mar 7, 2024
1 parent cf8275c commit 2087ba1
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: hasher

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
tests:
name: py${{ matrix.python-version}}

runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.8, 3.9, 3.11, 3.12]

steps:
- uses: actions/checkout@v4

- name: Bootstrap poetry
run: pipx install poetry

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry

- name: Configure poetry
run: poetry config virtualenvs.in-project true

- name: Check lock file
run: poetry check --lock

- name: Install dependencies
run: poetry install --with github-actions

- name: Run linters
run: make lint

- name: Run tests
run: make test
16 changes: 15 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ mypy = "^1.8.0"
pytest-cov = "^4.1.0"
pytest-mock = "^3.12.0"

# only used in github actions
[tool.poetry.group.github-actions]
optional = true

[tool.poetry.group.github-actions.dependencies]
pytest-github-actions-annotate-failures = "^0.2.0"

[tool.coverage.run]
branch = true
omit = ["tests/*"]
Expand Down

0 comments on commit 2087ba1

Please sign in to comment.