Version update #142
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: Unit Tests | |
| on: | |
| push: | |
| branches-ignore: | |
| - 'test_deploy' | |
| pull_request: | |
| branches: | |
| - '*' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| run_linter: | |
| runs-on: ${{ matrix.config.os }} | |
| if: "!contains(github.event.head_commit.message, 'ci skip')" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - {name: 'current', os: ubuntu-latest, python: '3.9' } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.config.python }} | |
| - name: Install tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -U wheel setuptools | |
| pip install -U black flake8 | |
| - name: Lint with Black | |
| run: | | |
| cd Python | |
| black . --check --diff | |
| - name: Lint with flake8 | |
| run: | | |
| flake8 phate || true | |
| run_tester: | |
| runs-on: ${{ matrix.config.os }} | |
| if: "!contains(github.event.head_commit.message, 'ci skip')" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - {name: '3.13', os: ubuntu-latest, python: '3.13' } | |
| - {name: '3.12', os: ubuntu-latest, python: '3.12' } | |
| - {name: '3.11', os: ubuntu-latest, python: '3.11' } | |
| - {name: '3.10', os: ubuntu-latest, python: '3.10' } | |
| - {name: '3.9', os: ubuntu-latest, python: '3.9' } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install system dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y libhdf5-dev libhdf5-serial-dev pandoc gfortran libblas-dev liblapack-dev libedit-dev llvm-dev libcurl4-openssl-dev ffmpeg | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.config.python }} | |
| - name: Cache Python packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.pythonLocation }} | |
| key: ${{runner.os}}-${{ matrix.config.python }}-pip-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} | |
| restore-keys: ${{runner.os}}-${{ matrix.config.python }}-pip-${{ env.pythonLocation }}- | |
| - name: Install package & dependencies | |
| run: | | |
| cd Python | |
| python -m pip install --upgrade pip | |
| pip install -U wheel setuptools | |
| pip install -e .[test] | |
| python -c "import phate" | |
| - name: Run tests with coverage | |
| run: | | |
| cd Python | |
| pip install coverage pytest-cov | |
| pytest --cov=. --cov-report=lcov:coverage.lcov -vv | |
| - name: Coveralls | |
| uses: coverallsapp/github-action@v2 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| path-to-lcov: Python/coverage.lcov | |
| continue-on-error: true | |
| - name: Upload check results on fail | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.config.name }}_results | |
| path: check | |