Skip to content

Second attempt at adding Codecov support (#161) #835

Second attempt at adding Codecov support (#161)

Second attempt at adding Codecov support (#161) #835

Workflow file for this run

name: unit tests
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop, releases/** ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# TODO: add macos-latest
os: [ubuntu-latest]
python-version: [3.8, 3.9, "3.10", "3.11"]
exclude:
- os: macos-latest
python-version: [3.5, 3.6]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up Node
uses: actions/setup-node@v4
with:
# Obtain the latest cached version of npm (either local cache or action cache)
node-version: node
- name: Install Python3 dependencies
run: |
python -m pip install --upgrade pip pytest
pip install -r requirements.txt
python -m pip install --upgrade --force-reinstall git+https://github.com/LLNL/hatchet.git@develop
python setup.py install
python setup.py build_ext --inplace
python -m pip list
- name: Update Black
if: ${{ matrix.python-version == 3.8 }}
run: |
pip install flake8-pytest-importorskip
pip install --upgrade click==8.0.4
pip install black==21.12b0
pip install flake8==4.0.1
- name: Lint and Format Check with Flake8 and Black
if: ${{ matrix.python-version == 3.8 }}
run: |
black --diff --check .
flake8
- name: Check License Headers
run: |
python license.py verify
- name: Install ExtraP
if: ${{ matrix.python-version >= 3.7 }}
run: |
pip install extrap
- name: Install coverage tools
run: |
pip install codecov
pip install pytest-cov
- name: Basic Test with pytest
run: |
PYTHONPATH=. $(which pytest) --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.THICKET_CODECOV_TOKEN }}
with:
directory: ./coverage/reports/
env_vars: OS,PYTHON
files: /home/runner/work/thicket/thicket/coverage.xml
flags: unittests
verbose: true
fail_ci_if_error: true