Skip to content

Add GitHub Actions workflow for unit tests #11

Add GitHub Actions workflow for unit tests

Add GitHub Actions workflow for unit tests #11

Workflow file for this run

name: Python Unit Tests with Debugging
on:
push:
branches:
- 315-Unittest-via-Github-actions
pull_request:
branches:
- 315-Unittest-via-Github-actions
jobs:
run-tests:
name: Run Unit Tests Across Python Versions
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
test-engine: ["PYTEST", "UNITTEST"]
continue-on-error: true
steps:
# Step 1: Checkout the repository
- name: Checkout Repository
uses: actions/checkout@v3
# Step 2: Set up Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# Step 3: Verify Directory Structure
- name: Verify Directory Structure
run: |
echo "Listing files to verify directory structure:"
ls -R ${GITHUB_WORKSPACE}
# Step 4: Run Tests
- name: Run Tests
continue-on-error: true
run: |
TEST_PATH="${{ github.workspace }}/FiLiP/tests"
echo "Testing path: $TEST_PATH"
if [ "${{ matrix.test-engine }}" == "PYTEST" ]; then
python -m pytest $TEST_PATH/ || true;
else
python -m unittest discover --verbose $TEST_PATH "test_*.py" || true;
fi