Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,49 @@
name: Run Pytest

on:
# Automatic runs
push:
branches: ["main", "master"]

pull_request:
branches: ["main", "master"]

# Manual run with parameter
workflow_dispatch:
inputs:
suite:
description: 'Test suite to run (sanity / smoke / regression)'
required: true
default: 'sanity'

jobs:
test:
runs-on: ubuntu-latest

# strategy:
# matrix:
# python-version: ["3.9", "3.10", "3.11"]

steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest

# ⭐ Normalize parameter (Jenkins-style)
- name: Set test suite
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "SUITE=${{ github.event.inputs.suite }}" >> $GITHUB_ENV
else
echo "SUITE=sanity" >> $GITHUB_ENV
fi

- name: Run pytest
run: |
pytest -vsm sanity
echo "Running test suite: $SUITE"
pytest -vs -m $SUITE