Skip to content

Merge remote-tracking branch 'origin/develop' into develop #375

Merge remote-tracking branch 'origin/develop' into develop

Merge remote-tracking branch 'origin/develop' into develop #375

Workflow file for this run

name: Run tests
on:
push:
branches-ignore:
- main
jobs:
code-coverage:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"] #TODO: PYTHON 3.12
os: [ubuntu-latest, windows-latest, macOS-latest] #TODO: WHY NOT SPECIFIC VERSION
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set PYTHONPATH
run: |
echo "PYTHONPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
env:
GITHUB_ENV: ${{ runner.workspace }}/.env
- uses: actions/cache@v3
with:
path: |
${{ env.pythonLocation }}
.venv
key: pytest-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'pdm.lock') }}
- name: Install dependencies
# we use --no-lock so it doesn't update the lock file if it's out of date.
run: |
python -m pip install --upgrade pdm
pdm install --no-lock -G test -G pipeline
#- name: Run PyTest # ARTIFACT: in case there is a reason to run all tests, this is the config that worked
# run pytest on all files that start with "test_" and have a ".py" extension.
#run: |
# pdm run pytest -k "tests/ and Test_"
- name: Run Unittests
# CI/CD-Optimization: Only run Unittets on ubuntu-runs because we expect the behaviour to be the same across OS systems,
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
working-directory: ./ # This sets the working directory to the repository root
run: |
pdm run pytest -v tests/Test_Extractable_Unittests/*
echo "### ✔ Succesfully ran Unittests!" >> $GITHUB_STEP_SUMMARY
- name: Run Component Tests on Windows
if: matrix.os == 'windows-latest'
#working-directory: ./ # Set the working directory to the repository root
run: |
pdm run pytest -v -k components
echo "### ✔ Succesfully Component-tested on windows with python-${{ matrix.python-version }}! " >> $GITHUB_STEP_SUMMARY
- name: Run Component Tests on Ubuntu
if: matrix.os == 'ubuntu-latest'
#working-directory: ./ # Set the working directory to the repository root
run: |
python -m venv myenv
source myenv/bin/activate
python -m pip install pytest
pdm install
pdm add
pip install -r requirements.txt
#TODO: dont perform the venv and pdm installation as these should be unnecessary
#after it has been done in prior steps
pytest tests/Test_Extractable_Components/*
echo "### ✔ Succesfully Component-tested on Ubuntu with python-${{ matrix.python-version }}!" >> $GITHUB_STEP_SUMMARY
- name: Run Component Tests on MacOS
if: matrix.os == 'macOS-latest'
#working-directory: ./ # Set the working directory to the repository root
run: |
python -m venv myenv
source myenv/bin/activate
python -m pip install pytest
pdm install
pdm add
pip install -r requirements.txt
#TODO: dont perform the venv and pdm installation as these should be unnecessary
#after it has been done in prior steps
pytest tests/Test_Extractable_Components/*
echo "### ✔ Succesfully Component-tested on macOS with python-${{ matrix.python-version }}!" >> $GITHUB_STEP_SUMMARY
- name: Run E2E Tests on Windows
if: matrix.os == 'windows-latest'
#working-directory: ./ # Set the working directory to the repository root
run: |
pdm run pytest -v -k e2e
echo "### ✔ Succesfully e2e tested windows with python-${{ matrix.python-version }}! " >> $GITHUB_STEP_SUMMARY
- name: Run E2E Tests on Ubuntu
if: matrix.os == 'ubuntu-latest'
#working-directory: ./ # Set the working directory to the repository root
run: |
python -m venv myenv
source myenv/bin/activate
python -m pip install pytest
pdm install
pdm add
pip install -r requirements.txt
#TODO: dont perform the venv and pdm installation as these should be unnecessary
#after it has been done in prior steps
pytest tests/Test_e2e_blackbox/*
echo "### ✔ Succesfully e2e tested Ubuntu with python-${{ matrix.python-version }}!" >> $GITHUB_STEP_SUMMARY
- name: Run E2E Tests on MacOS
if: matrix.os == 'macOS-latest'
#working-directory: ./ # Set the working directory to the repository root
run: |
python -m venv myenv
source myenv/bin/activate
python -m pip install pytest
pdm install
pdm add
pip install -r requirements.txt
#TODO: dont perform the venv and pdm installation as these should be unnecessary
#after it has been done in prior steps
pytest tests/Test_e2e_blackbox/*
echo "### ✔ Succesfully e2e tested macOS with python-${{ matrix.python-version }}!" >> $GITHUB_STEP_SUMMARY
#TODO: also test if publishing to testPypi and then executing e2e works, before allowing push to be accepted