Merge branch 'main' into dependabot/github_actions/actions/checkout-6 #19
Workflow file for this run
This file contains hidden or 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
| # SPDX-FileCopyrightText: 2025 German Aerospace Center (DLR) | |
| # SPDX-License-Identifier: CC0-1.0 | |
| name: Main | |
| on: | |
| - push | |
| - pull_request | |
| - workflow_dispatch | |
| jobs: | |
| # ## BUILD PROJECT AND CACHE ################################################ | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| cache: pip | |
| - name: Install dependencies | |
| run: pip install -U -e ".[all]" | |
| # ## LINTER AND STATIC CHECKS ############################################### | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| cache: pip | |
| - name: Install dependencies | |
| run: pip install -U -e ".[all]" | |
| - uses: pre-commit/[email protected] | |
| ruff-formatter: | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| cache: pip | |
| - name: Install dependencies | |
| run: pip install -U -e ".[all]" | |
| - name: Run ruff formatter checks | |
| run: python -m ruff format --diff md_multiline_table tests | |
| ruff-linter: | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| cache: pip | |
| - name: Install dependencies | |
| run: pip install -U -e ".[all]" | |
| - name: Run ruff linter checks | |
| run: python -m ruff check --output-format=github md_multiline_table tests | |
| mypy: | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| cache: pip | |
| - name: Install dependencies | |
| run: pip install -U -e ".[all]" | |
| - name: Run mypy checks | |
| run: python -m mypy md_multiline_table | |
| doc: | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: DavidAnson/markdownlint-cli2-action@v21 | |
| with: | |
| globs: | | |
| README.md | |
| docs/**/*.md | |
| license: | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| cache: pip | |
| - name: Install dependencies | |
| run: pip install -U licensecheck reuse | |
| - name: License check | |
| run: python -m licensecheck | |
| - name: Reuse check | |
| run: python -m reuse lint | |
| vulnerability: | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| cache: pip | |
| - name: Install dependencies | |
| run: pip install -U tox~=4.26.0 | |
| - name: Vulnerability check | |
| run: python -m tox --recreate -e vulnerability | |
| # ## TESTS ################################################################## | |
| py-tests: | |
| runs-on: ubuntu-latest | |
| needs: [build, pre-commit, ruff-formatter, ruff-linter, mypy, doc, license, vulnerability] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| cache: pip | |
| - name: Install dependencies | |
| run: pip install -U -e ".[all]" | |
| - name: Run unit tests | |
| run: python -m coverage run -m unittest discover --start-directory tests | |
| - name: Create coverage HTML report | |
| run: python -m coverage html --directory "./build/htmlcov" | |
| - name: Upload coverage report artifact | |
| uses: actions/upload-artifact@v5 | |
| with: | |
| name: HTML coverage report | |
| path: build/htmlcov | |
| # ## DOCUMENTATION ########################################################## | |
| documentation: | |
| runs-on: ubuntu-latest | |
| needs: [doc, py-tests] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.10' | |
| cache: pip | |
| - name: Install dependencies | |
| run: pip install -U -e ".[all]" | |
| - name: Download coverage report artifact | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: HTML coverage report | |
| path: build/htmlcov | |
| - name: Build documentation (GitHub Pages) | |
| env: | |
| DEPLOY: true | |
| run: python -m mkdocs build | |
| - name: Fix permissions | |
| run: | | |
| chmod -c -R +rX "site/" | while read line; do | |
| echo "::warning title=Invalid file permissions automatically fixed::$line" | |
| done | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: site | |
| # ## DEPLOY ################################################################# | |
| pages: | |
| if: ${{ contains(github.ref, 'main') || startsWith(github.ref, 'refs/tags/v') }} | |
| needs: [documentation] | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |