Skip to content

Commit

Permalink
Setup github actions for testing
Browse files Browse the repository at this point in the history
This is the basic setup of github actions to run pytest whenever merging, or on pull_request.
  • Loading branch information
MattsonCam authored Nov 19, 2024
1 parent ad9d0fc commit b193734
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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

# This workflow will install Python dependencies using Poetry and run tests with pytest on all supported Python versions

name: Python application

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

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.10", "3.11"]
steps:
- uses: actions/checkout@v4

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

- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"
- name: Install dependencies with Poetry
run: |
poetry install --no-interaction
- name: Test with pytest
run: |
poetry run pytest

0 comments on commit b193734

Please sign in to comment.