Skip to content

chore: add github actions #5

chore: add github actions

chore: add github actions #5

Workflow file for this run

name: build-and-test
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize]
paths:
- "**"
- "!docs/**"
- "!README.md"
- "!.github/**"
- .github/workflows/build-and-test.yaml
workflow_dispatch:
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check poetry existence
id: check-poetry
uses: andstor/file-existence-action@v3
with:
fail: false
files: "poetry.lock"
- name: Install poetry
if: steps.check-poetry.outputs.files_exists == true
run: pip install poetry
- name: Setup python (with pip)
if: steps.check-poetry.outputs.files_exists == false
uses: actions/setup-python@v5
with:
cache: "pip"
python-version-file: "pyproject.toml"
- name: Install dependencies
run: poetry install
- name: Run tests
run: poetry run pytest