Skip to content

Commit

Permalink
Start separation of unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Argmaster committed Nov 10, 2024
1 parent 83775f6 commit f9dce67
Show file tree
Hide file tree
Showing 62 changed files with 267 additions and 721 deletions.
67 changes: 0 additions & 67 deletions .github/workflows/code_quality.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
---
name: Build & Deploy Docs
name: Deploy Latest Documentation

on:
push:
tags:
- "v*"

workflow_dispatch:

concurrency:
group: ${{ github.action_path }}-${{ github.ref }}-build-n-deploy-docs
group: ${{ github.action_path }}-${{ github.ref }}-latest-docs
cancel-in-progress: false

jobs:
run-build-n-deploy-docs:
docs:
strategy:
fail-fast: false
matrix:
Expand All @@ -35,16 +34,18 @@ jobs:
architecture: "x64"

- name: Install Poetry
run: pip install poetry==1.6.1
run: pip install poetry==1.8.4

- name: Install base dependencies
run: poetry install --no-cache

- name: Install dependencies
run: poetry install --with=docs --no-cache --sync --extras=all
- name: Prepare environment for docs deploy
run: poetry run poe prepare-deploy-docs

- name: Configure Git
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Run build & deploy documentation
run: |
poetry run mike deploy --push --update-aliases $(poetry version | awk '{ print $2 }') latest -F mkdocs.yaml
- name: Deploy documentation
run: poetry run poe run deploy-latest-docs
11 changes: 3 additions & 8 deletions .github/workflows/release_to_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,14 @@ jobs:
architecture: "x64"

- name: Install Poetry 📜
run: pip install poetry==1.6.1
run: pip install poetry==1.8.4

- name: Install dependencies 🗄️
run: poetry install --no-cache --sync
- name: Install base dependencies 🗄️
run: poetry install --no-cache

- name: Build distribution 📦
run: poetry run poetry build

- name: Detect Version of project
id: project-version
run: |
echo "version=$(poetry version | awk '{ print $2 }')" >> $GITHUB_OUTPUT
- name: Publish distribution 📦 to PyPI
# Executed only for version tag push event
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/release_to_test_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ name: Publish 📦 to Test PyPI
on:
push:
branches:
- dev
- main
- release/**
- maintenance/**

jobs:
deploy-to-pypi:
Expand All @@ -27,10 +24,10 @@ jobs:
architecture: "x64"

- name: Install Poetry 📜
run: pip install poetry==1.6.1
run: pip install poetry==1.8.4

- name: Install dependencies 🗄️
run: poetry install --no-cache --sync
- name: Install base dependencies 🗄️
run: poetry install --no-cache

- name: Bump Version for development 🔨 release
run: |
Expand Down
66 changes: 66 additions & 0 deletions .github/workflows/test_all.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: All Tests

on:
push:
paths:
- src/**
- test/**
- .github/**
- pyproject.toml
- poetry.lock
schedule:
- cron: 0 12 * * 6
workflow_dispatch:

concurrency:
group: ${{ github.action_path }}-${{ github.ref }}-test-all
cancel-in-progress: false

jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.8", "3.13"]

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/[email protected]

- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"

- name: Install Poetry
run: pip install poetry==1.8.4

- name: Install basic dependencies
run: poetry install --no-cache

- name: Prepare environment for all tests
run: poetry run poe prepare-test-all

- name: Run all tests
run: poetry run poe test-all

- name: Create XML coverage files
run: poetry run coverage xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
flags: all
files: ./coverage.xml
verbose: true
66 changes: 66 additions & 0 deletions .github/workflows/test_e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: End-to-End Tests

on:
push:
paths:
- src/**
- test/**
- .github/**
- pyproject.toml
- poetry.lock
schedule:
- cron: 0 12 * * 6
workflow_dispatch:

concurrency:
group: ${{ github.action_path }}-${{ github.ref }}-test-e2e
cancel-in-progress: false

jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/[email protected]

- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"

- name: Install Poetry
run: pip install poetry==1.8.4

- name: Install basic dependencies
run: poetry install --no-cache

- name: Prepare environment for e2e tests
run: poetry run poe prepare-test-e2e

- name: Run e2e tests
run: poetry run poe test-e2e

- name: Create XML coverage files
run: poetry run coverage xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
flags: e2e
files: ./coverage.xml
verbose: true
44 changes: 44 additions & 0 deletions .github/workflows/test_style.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Test Style

on:
push:
schedule:
- cron: 0 12 * * 6
workflow_dispatch:

concurrency:
group: ${{ github.action_path }}-${{ github.ref }}-code-quality
cancel-in-progress: false

jobs:
tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.11"]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/[email protected]

- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"

- name: Install Poetry
run: pip install poetry==1.8.4

- name: Install basic dependencies
run: poetry install --no-cache

- name: Prepare environment for style tests
run: poetry run poe prepare-test-style

- name: Run style tests
run: poetry run poe test-style
Loading

0 comments on commit f9dce67

Please sign in to comment.