Bump github/codeql-action from 3 to 4 #490
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
| # Test Code. | |
| # | |
| # See: | |
| # https://docs.github.com/en/actions/guides/building-and-testing-python | |
| name: "Tests" | |
| on: | |
| push: | |
| branches: | |
| - "**" | |
| paths: | |
| - ".github/**" | |
| - "**.py" | |
| - "**.rst" | |
| - "docs/**" | |
| - ".flake8" | |
| - "pyproject.toml" | |
| - "**requirements*.txt" | |
| tags: | |
| - "v[0-9]*" | |
| release: | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| # Tests must be run on all target platforms and Python versions | |
| # Python <3.8 is not supported in the MacOS 14 runner. | |
| os: | |
| - "ubuntu-latest" | |
| - "macos-13" | |
| - "windows-latest" | |
| python-version: | |
| - "3.7" | |
| - "3.8" | |
| - "3.9" | |
| # Python 3.7 is not supported in the Ubuntu 24.04 runner | |
| exclude: | |
| - os: "ubuntu-latest" | |
| python-version: "3.7" | |
| include: | |
| - os: "ubuntu-22.04" | |
| python-version: "3.7" | |
| # Do not cancel in-progress jobs if any matrix job fails | |
| fail-fast: false | |
| runs-on: "${{ matrix.os }}" | |
| steps: | |
| - name: "Checkout repository" | |
| uses: "actions/checkout@v4" | |
| - name: "Set up Python ${{ matrix.python-version }}" | |
| uses: "actions/setup-python@v5" | |
| with: | |
| python-version: "${{ matrix.python-version }}" | |
| - name: "Add directories where pip installs scripts to PATH" | |
| run: | | |
| echo "${HOME}/.local/bin" >> ${GITHUB_PATH} | |
| # Installation path on MacOS for Python >=3.11. | |
| echo "/Users/runner/Library/Python/${{ matrix.python-version }}/bin" >> ${GITHUB_PATH} | |
| - name: "Get pip cache dir" | |
| # pip's cache path depends on the operating system. See | |
| # https://github.com/actions/cache/blob/main/examples.md#python---pip | |
| # This requires pip >=20.1. | |
| id: "pip-cache" | |
| run: | | |
| python -m pip install --user --upgrade pip | |
| echo "dir=$(pip cache dir)" >> ${GITHUB_OUTPUT} | |
| - name: "Create/Restore cache" | |
| uses: "actions/cache@v4" | |
| with: | |
| path: | | |
| ${{ steps.pip-cache.outputs.dir }}/** | |
| ./docs/build/** | |
| key: | | |
| ${{ runner.os }}-${{ matrix.python-version }}-${{ github.job }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.python-version }} | |
| ${{ runner.os }} | |
| - name: "Install/Upgrade setuptools and wheel" | |
| # MDAnalysis requires NumPy (>=1.19.2) for setup (see also | |
| # https://github.com/MDAnalysis/mdanalysis/issues/3374#issuecomment-889189979). | |
| # MDAnalysis <3.0 requires Cython <3.0 (see | |
| # https://github.com/MDAnalysis/mdanalysis/pull/4129 and | |
| # https://github.com/cython/cython/issues/3690). | |
| # Strangely, without `python-dev-tools` the installation of | |
| # MDAnalysis might fail while building the wheel. | |
| run: | | |
| python -m pip install --user --upgrade setuptools wheel | |
| python -m pip install --user --upgrade python-dev-tools | |
| python -m pip install --user "Cython <3.0" | |
| python -m pip install --user "numpy >=1.19.2" | |
| - name: "Test installation of this project" | |
| run: | | |
| python -m pip install --user . | |
| python -c "import lintf2_ether_ana_postproc" |