Updated to actions/checkout@v6 and actions/setup-python@v6 #350
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 (tests, flake8, mypy) | |
| on: | |
| push: | |
| paths-ignore: | |
| - 'changelog.rst' | |
| pull_request: | |
| schedule: | |
| - cron: '0 11 * * 4' | |
| jobs: | |
| skip_duplicate: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
| steps: | |
| - id: skip_check | |
| uses: fkirc/skip-duplicate-actions@master | |
| with: | |
| github_token: ${{ github.token }} | |
| analyse: | |
| name: Analyse | |
| needs: skip_duplicate | |
| if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| # Initializes the CodeQL tools for scanning. | |
| - name: Initialize CodeQL | |
| uses: github/codeql-action/init@v4 | |
| # Override language selection | |
| with: | |
| languages: python | |
| - name: Perform CodeQL Analysis | |
| uses: github/codeql-action/analyze@v4 | |
| test-pip: | |
| needs: skip_duplicate | |
| if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }} | |
| strategy: | |
| matrix: | |
| python-version: [ 3.9, "3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.9", "pypy3.10", "pypy3.11" ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade -r requirements_ci.txt | |
| - name: Lint all python files with flake8 | |
| run: | | |
| # stop the build if there are flake8 errors | |
| flake8 src tests --count --show-source --statistics | |
| - name: Type check package source with mypy (except pypy) | |
| if: ${{ !startsWith(matrix.python-version, 'pypy') }} | |
| run: | | |
| mypy src/nographs | |
| - name: Check source code formatting with Black (except python 3.9) | |
| if: ${{ !contains(matrix.python-version, '3.9') }} | |
| run: | | |
| black src/nographs tests --check --verbose --diff | |
| - name: Install from source (required for the pre-commit tests) | |
| run: python -m pip install . | |
| - name: Run all tests (including doc tests) | |
| run: python ./tests/test_nographs.py | |
| - name: Upload coverage | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| fail_ci_if_error: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout source | |
| uses: actions/checkout@v6 | |
| - name: Set up Python 3.9 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.9 | |
| - name: Build package | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade build | |
| python -m build | |
| python -m pip install dist/*.tar.gz | |
| echo "Install went OK" | |
| # publish: | |
| # name: Publish to PyPI | |
| # needs: build | |
| # if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - name: Checkout source | |
| # uses: actions/checkout@v6 | |
| # - name: Set up Python 3.9 | |
| # uses: actions/setup-python@6 | |
| # with: | |
| # python-version: 3.9 | |
| # - name: Build package | |
| # run: | | |
| # pip install wheel | |
| # python setup.py sdist bdist_wheel | |
| # - name: Publish | |
| # uses: pypa/gh-action-pypi-publish@v1.1.0 | |
| # with: | |
| # user: __token__ | |
| # password: ${{ secrets.PYPI_API_TOKEN }} |