Feature/586 block diagonal direct #600
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests, docs, package | |
on: | |
push: | |
branches: [develop, master] | |
pull_request: | |
branches: [develop] | |
workflow_dispatch: | |
inputs: | |
reason: | |
description: Why did you trigger the pipeline? | |
required: False | |
default: Check if it runs again due to external changes | |
env: | |
GITHUB_BOT_USERNAME: github-actions[bot] | |
GITHUB_BOT_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com | |
PY_COLORS: 1 | |
MYPY_FORCE_COLOR: 1 | |
PANDOC_VERSION: '3.1.6.2' | |
jobs: | |
code-quality: | |
name: Lint code and check type hints | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python 3.8 | |
uses: ./.github/actions/python | |
with: | |
python_version: 3.8 | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit-${{ env.pythonLocation }}-${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: Lint Code | |
run: | | |
pre-commit run --all --show-diff-on-failure | |
python build_scripts/run_pylint.py | (pylint-json2html -f jsonextended -o pylint.html) | |
shell: bash | |
- name: Generate mypy cache key | |
id: generate-mypy-cache-key | |
run: | | |
MYPY_VERSION=$(mypy --version | sed 's/[^0-9.]*\([0-9.]*\).*/\1/') | |
echo "key=mypy-$MYPY_VERSION-${{ env.pythonLocation }}" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v4 | |
with: | |
path: .mypy_cache | |
key: ${{ steps.generate-mypy-cache-key.outputs.key }} | |
- name: Check Type Hints | |
run: mypy src/ | |
docs: | |
name: Build Docs | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Setup Python 3.8 | |
uses: ./.github/actions/python | |
with: | |
python_version: 3.8 | |
- name: Install Pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
with: | |
pandoc-version: ${{ env.PANDOC_VERSION }} | |
- name: Build Docs | |
run: mkdocs build | |
group-tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
python_version: ["3.8", "3.9", "3.10", "3.11"] | |
group_number: [1, 2, 3, 4] | |
name: Run Tests - Python ${{ matrix.python_version }} - Group ${{ matrix.group_number }} | |
uses: ./.github/workflows/run-tests-workflow.yaml | |
secrets: inherit | |
with: | |
split_size: 4 | |
group_number: ${{ matrix.group_number }} | |
python_version: ${{ matrix.python_version }} | |
needs: [code-quality] | |
notebook-tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
python_version: ["3.8", "3.9", "3.10", "3.11"] | |
group_number: [1, 2, 3, 4] | |
name: Run Notebook tests - Python ${{ matrix.python_version }} - Group ${{ matrix.group_number }} | |
uses: ./.github/workflows/run-notebook-tests-workflow.yaml | |
with: | |
python_version: ${{ matrix.python_version }} | |
split_size: 4 | |
group_number: ${{ matrix.group_number }} | |
needs: [code-quality] | |
push-docs-and-release-testpypi: | |
name: Push Docs and maybe release Package to TestPyPI | |
runs-on: ubuntu-latest | |
needs: [docs, group-tests, notebook-tests] | |
if: ${{ github.ref == 'refs/heads/develop' }} | |
concurrency: | |
group: publish | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- name: Setup Python 3.8 | |
uses: ./.github/actions/python | |
with: | |
python_version: 3.8 | |
- name: Install Pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
with: | |
pandoc-version: ${{ env.PANDOC_VERSION }} | |
- name: Deploy Docs | |
uses: ./.github/actions/deploy-docs | |
with: | |
version: devel | |
alias: develop | |
title: Development | |
email: ${{ env.GITHUB_BOT_EMAIL }} | |
username: ${{ env.GITHUB_BOT_USERNAME }} | |
- name: Build and publish to TestPyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PASSWORD }} | |
run: | | |
set -x | |
export BUILD_NUMBER=$GITHUB_RUN_NUMBER | |
bump2version --no-tag --no-commit --verbose --serialize '{major}.{minor}.{patch}.{release}{$BUILD_NUMBER}' boguspart | |
python setup.py sdist bdist_wheel | |
twine upload -r testpypi --verbose --non-interactive dist/* |