Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(CI): split up test action into several jobs #553

Merged
merged 5 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 0 additions & 27 deletions .github/actions/preparation/action.yml

This file was deleted.

133 changes: 99 additions & 34 deletions .github/workflows/tests-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,70 +10,145 @@ 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
# 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

others:
name: Other Tests
BalduinLandolt marked this conversation as resolved.
Show resolved Hide resolved
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)
########################################################
Expand All @@ -94,13 +169,3 @@ jobs:
uses: mfinelli/setup-imagemagick@v2 # downloads the "magick" AppImage to ~/bin/magick


# Run e2e 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