Skip to content

Commit

Permalink
chore(CI): split up test action into several jobs (#553)
Browse files Browse the repository at this point in the history
  • Loading branch information
BalduinLandolt committed Oct 5, 2023
1 parent 2084999 commit cfb5042
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 60 deletions.
27 changes: 0 additions & 27 deletions .github/actions/preparation/action.yml

This file was deleted.

104 changes: 71 additions & 33 deletions .github/workflows/tests-on-push.yml
Expand Up @@ -10,73 +10,117 @@ on:


jobs:
tests-on-push:
build-docs:
name: Build docs
runs-on: ubuntu-latest
steps:

# Checkout source, install Python, install dependencies
######################################################
# Setup
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: recursive

- name: Install poetry
run: |
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry self add poetry-exec-plugin
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
# attempt to restore dependencies from cache (if successful, the following `poetry install` will be a no-op)
cache: poetry

- name: Install Python dependencies
run: poetry install


# Build and check docs
######################
# run tests
- name: build docs
run: poetry run mkdocs build --strict

- name: check external links in docs
run: |
npm install -g markdown-link-validator
poetry exec check-links
- name: markdownlint
run: docker run -v $PWD:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest --config .markdownlint.yml --ignore CHANGELOG.md "**/*.md"


# Code Linting
##############
lint:
name: Lint code
runs-on: ubuntu-latest
steps:
# Setup
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry self add poetry-exec-plugin
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
# attempt to restore dependencies from cache (if successful, the following `poetry install` will be a no-op)
cache: poetry
- name: Install Python dependencies
run: poetry install
# run tests
- name: Linting with Pylint
run: poetry run pylint src test

- name: Linting with mypy
run: poetry run mypy .

- name: Linting with black
run: poetry run black --check .

- name: Linting with isort
run: poetry run isort . --check --diff

- name: Linting with darglint
run: poetry exec darglint


# Run unittests
###############
unittests:
name: Run Unittests
runs-on: ubuntu-latest
steps:
# Setup
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry self add poetry-exec-plugin
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
# attempt to restore dependencies from cache (if successful, the following `poetry install` will be a no-op)
cache: poetry
- name: Install Python dependencies
run: poetry install
# run tests
- name: unittests
run: poetry run pytest test/unittests/


e2e-tests:
name: Run E2E/Integration Tests
runs-on: ubuntu-latest
steps:
# Setup
- name: Checkout source
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry self add poetry-exec-plugin
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
# attempt to restore dependencies from cache (if successful, the following `poetry install` will be a no-op)
cache: poetry
- name: Install Python dependencies
run: poetry install
# Install programs for local processing (fast xmlupload)
########################################################
- name: Fast xmlupload - Install ffmpeg
uses: FedericoCarboni/setup-ffmpeg@v2

Expand All @@ -88,19 +132,13 @@ jobs:
with:
path: ~/bin/magick # AppImage containing all binaries + dependencies
key: imagemagick # don't check for a new version, because version checking is fairly complex

- name: Fast xmlupload - ImageMagick - Installation
if: ${{ steps.search-cached-imagemagick.outputs.cache-hit != 'true' }}
uses: mfinelli/setup-imagemagick@v2 # downloads the "magick" AppImage to ~/bin/magick


# Run e2e tests
###############
# run tests
- name: start stack
run: poetry run dsp-tools start-stack --no-prune

- name: e2e tests
run: poetry run pytest test/e2e/

- name: stop stack # see if this command can run (it isn't tested anywhere else)
run: poetry run dsp-tools stop-stack

0 comments on commit cfb5042

Please sign in to comment.