Skip to content

Add GitHub Actions workflow for running pytest #1

Add GitHub Actions workflow for running pytest

Add GitHub Actions workflow for running pytest #1

Workflow file for this run

name: Python Tests
on:
push:
branches:
- main # Trigger the workflow when changes are pushed to the main branch
pull_request:
branches:
- main # Trigger the workflow on pull requests targeting the main branch
jobs:
test:
runs-on: ubuntu-latest # Use the latest Ubuntu runner for the job
steps:
# Step 1: Checkout the code
- name: Checkout code
uses: actions/checkout@v2
# Step 2: Set up Python (using a version from your project, e.g., 3.11)
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11' # Set the Python version you want to use
# Step 3: Install dependencies (e.g., from requirements.txt)
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# Step 4: Run pytest
- name: Run pytest
run: |
pytest --maxfail=1 --disable-warnings -v # You can customize pytest flags here