|
| 1 | +name: unit tests to collect code coverage |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ develop ] |
| 6 | + secrets: |
| 7 | + THICKET_CODECOV_TOKEN: |
| 8 | + required: true |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + |
| 13 | + runs-on: ${{ matrix.os }} |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + os: [ubuntu-22.04] |
| 17 | + python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13"] |
| 18 | + exclude: |
| 19 | + - os: macos-latest |
| 20 | + python-version: [3.5, 3.6] |
| 21 | + |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - name: Set up Python ${{ matrix.python-version }} |
| 26 | + uses: actions/setup-python@v5 |
| 27 | + with: |
| 28 | + python-version: ${{ matrix.python-version }} |
| 29 | + |
| 30 | + - name: Install Python Dependencies for 3.12 and later |
| 31 | + if: ${{ matrix.python-version >= '3.12' }} |
| 32 | + run: | |
| 33 | + python -m pip install --upgrade pip pytest setuptools wheel |
| 34 | + pip install -r requirements.txt |
| 35 | + # Optional Dependency for HDF Checkpointing |
| 36 | + pip install tables |
| 37 | + python setup.py install |
| 38 | + python setup.py build_ext --inplace |
| 39 | + python -m pip list |
| 40 | +
|
| 41 | + - name: Standard Install Python3 Dependencies |
| 42 | + run: | |
| 43 | + python -m pip install --upgrade pip pytest |
| 44 | + pip install -r requirements.txt |
| 45 | + # Optional Dependency for HDF Checkpointing |
| 46 | + pip install tables |
| 47 | + python setup.py install |
| 48 | + python setup.py build_ext --inplace |
| 49 | + python -m pip list |
| 50 | +
|
| 51 | + - name: Install coverage tools |
| 52 | + run: | |
| 53 | + pip install codecov |
| 54 | + pip install pytest-cov |
| 55 | +
|
| 56 | + - name: Basic Test with pytest |
| 57 | + run: | |
| 58 | + PYTHONPATH=. $(which pytest) --cov=./ --cov-report=xml |
| 59 | +
|
| 60 | + - name: Upload coverage to Codecov |
| 61 | + uses: codecov/codecov-action@v4 |
| 62 | + env: |
| 63 | + CODECOV_TOKEN: ${{ secrets.THICKET_CODECOV_TOKEN }} |
| 64 | + with: |
| 65 | + directory: ./coverage/reports |
| 66 | + env_vars: OS,PYTHON |
| 67 | + files: /home/runner/work/hatchet/hatchet/coverage.xml |
| 68 | + flags: unittests |
| 69 | + verbose: true |
| 70 | + fail_ci_if_error: true |
0 commit comments