This is a GitHub Action for setting up an environment based on Poetry in the repository.
It simplifies the process of building and caching the environment directly.
inputs:
python-version:
description: "Python Version"
required: true
name: "Usage: run pytest with poetry-build-action"
on: [push]
jobs:
test:
name: "Test"
runs-on: ubuntu-24.04
steps:
#----------------------------------------------
# Check out repo
#----------------------------------------------
- name: "Check out repository"
uses: actions/checkout@v4
#----------------------------------------------
# Build & Cache environment with poetry
#----------------------------------------------
- name: "Build & Cache with Poetry"
uses: devbruce/[email protected]
with:
python-version: "3.12"
#----------------------------------------------
# Run tests on poetry environment
#----------------------------------------------
- name: "Run tests"
run: |
poetry run pytest tests/
- Maintainer: @devbruce