make robust against unknown RunStatus #3
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
| name: CI | |
| on: | |
| workflow_dispatch: # allow manual triggering | |
| push: | |
| branches: | |
| - '**' # run on all branches | |
| tags: | |
| - '*' # run on tag pushes so it can trigger the publish workflow | |
| pull_request: | |
| branches: | |
| - '**' # run on all branches | |
| jobs: | |
| pydocstyle: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.x | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - name: Cache pip packages | |
| uses: actions/cache@v4 | |
| env: | |
| cache-name: cache-pypi-modules | |
| with: | |
| # pip cache files are stored in `~/.cache/pip` on Linux | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pydocstyle-${{ env.cache-name }}-${{ hashFiles('requirements/production.txt', 'requirements/testing.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pydocstyle-${{ env.cache-name }}- | |
| - name: Install dependencies | |
| run: pip install -r requirements/testing.txt | |
| - name: Pydocstyle | |
| run: pydocstyle pyvlx test/*.py examples/*.py | |
| flake8: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.x | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - name: Cache pip packages | |
| uses: actions/cache@v4 | |
| env: | |
| cache-name: cache-pypi-modules | |
| with: | |
| # pip cache files are stored in `~/.cache/pip` on Linux | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-flake8-${{ env.cache-name }}-${{ hashFiles('requirements/production.txt', 'requirements/testing.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-flake8-${{ env.cache-name }}- | |
| - name: Install dependencies | |
| run: pip install -r requirements/testing.txt | |
| - name: Flake8 | |
| run: flake8 | |
| pylint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.x | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - name: Cache pip packages | |
| uses: actions/cache@v4 | |
| env: | |
| cache-name: cache-pypi-modules | |
| with: | |
| # pip cache files are stored in `~/.cache/pip` on Linux | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pylint-${{ env.cache-name }}-${{ hashFiles('requirements/production.txt', 'requirements/testing.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pylint-${{ env.cache-name }}- | |
| - name: Install dependencies | |
| run: pip install -r requirements/testing.txt | |
| - name: Linter Pylint | |
| run: pylint pyvlx test/*.py examples/*.py | |
| isort: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.x | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.x" | |
| - name: Cache pip packages | |
| uses: actions/cache@v4 | |
| env: | |
| cache-name: cache-pypi-modules | |
| with: | |
| # pip cache files are stored in `~/.cache/pip` on Linux | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-isort-${{ env.cache-name }}-${{ hashFiles('requirements/production.txt', 'requirements/testing.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-isort-${{ env.cache-name }}- | |
| - name: Install dependencies | |
| run: pip install -r requirements/testing.txt | |
| - name: Isort | |
| run: isort --check-only test examples pyvlx | |
| mypy: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache pip packages | |
| uses: actions/cache@v4 | |
| env: | |
| cache-name: cache-pypi-modules | |
| with: | |
| # pip cache files are stored in `~/.cache/pip` on Linux | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-mypy-${{ env.cache-name }}-${{ hashFiles('requirements/production.txt', 'requirements/testing.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mypy-${{ env.cache-name }}- | |
| - name: Install dependencies | |
| run: pip install -r requirements/testing.txt | |
| - name: Mypy | |
| run: mypy --install-types --non-interactive pyvlx | |
| pytest: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Cache pip packages | |
| uses: actions/cache@v4 | |
| env: | |
| cache-name: cache-pypi-modules | |
| with: | |
| # pip cache files are stored in `~/.cache/pip` on Linux | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pytest-${{ env.cache-name }}-${{ hashFiles('requirements/production.txt', 'requirements/testing.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pytest-${{ env.cache-name }}- | |
| - name: Install dependencies | |
| run: pip install -r requirements/testing.txt | |
| - name: pytest | |
| run: pytest --cov pyvlx --cov-report xml | |
| notify-build: | |
| name: Notify build and publish workflow | |
| runs-on: ubuntu-latest | |
| needs: ["pydocstyle","flake8", "pylint", "mypy", "pytest", "isort"] | |
| steps: | |
| - name: Notify publish workflow | |
| # dispatch publish workflow when triggered by tag | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: peter-evans/repository-dispatch@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| event-type: ci-workflow-found-tag | |
| client-payload: '{"tag":"${{ github.ref_name }}", "sha":"${{ github.sha }}"}' | |