Skip to content

Automated testing pipeline #11

Automated testing pipeline

Automated testing pipeline #11

Workflow file for this run

name: Development Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Build wheel
run: |
pip install build
python3 -m build
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheel
path: dist
retention-days: 1
install:
runs-on: ubuntu-latest
needs: build
steps:
- name: prepare system
run: |
sudo apt-get update
sudo apt-get install -y build-essential
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Setting up virtual env
run: |
python -m pip install --upgrade pip
pip install virtualenv
virtualenv .venv
- name: Activate virtual env
run: |
source .venv/bin/activate
- name: Install dependencies
run: |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Getting build wheel
uses: actions/download-artifact@v4
with:
name: wheel
path: dist
- name: Install package
run: |
pip install dist/*.whl
- name: Upload virtual env
uses: actions/upload-artifact@v4
with:
name: venv
path: .venv
retention-days: 1
test:
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Getting the virtual env
uses: actions/download-artifact@v4
with:
name: venv
path: .venv
- name: Activate virtual env
run: |
source .venv/bin/activate
- name: Install test dependencies
run: |
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
- name: Lint with ruff
run: |
ruff check --select=ALL --output-format=github src/
- name: Test with pytest
run: |
pytest