Skip to content

Bump codecov/codecov-action from 3 to 4 #514

Bump codecov/codecov-action from 3 to 4

Bump codecov/codecov-action from 3 to 4 #514

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Tests
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
build:
name: ${{ matrix.os }} (py ${{ matrix.version }}${{ matrix.special }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
special: [""]
conda: [false]
include:
- os: ubuntu-latest
special: "; pre-release"
version: "3.11"
conda: false
- os: ubuntu-20.04
special: "; minimum version"
version: "3.6"
conda: true
- os: ubuntu-20.04
special: ""
version: "3.6"
conda: false
steps:
- uses: actions/checkout@v4
- name: Setup Conda
if: matrix.conda == true
uses: s-weigand/setup-conda@v1
with:
update-conda: false
- name: Set up Python
if: matrix.conda == false
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.version }}
- name: Install dependencies
run: |
case "${{ matrix.special }}" in
"; minimum version")
conda create -n test -c conda-forge python=${{ matrix.version }} rdkit==2018.03.1 numpy=1.15.0 pandas=0.23.0 h5py=2.7.0 scipy=0.19.1 contextlib2==0.6.0 typing-extensions==3.7.4.3 pytest==5.4.0 pyyaml=5.1.0 packaging==16.8 pytest-cov pytest-mock "pip<22"
source $CONDA/bin/activate test
pip install schema==0.7.2 Nano-Utils==0.4.3 AssertionLib==2.2.3 plams==1.5.1 qmflows==0.11.0
pip install -e . --no-dependencies
;;
"; pre-release")
pip install -e .[test] --pre --upgrade --force-reinstall
pip install git+https://github.com/nlesc-nano/data-CAT@master --upgrade
pip install git+https://github.com/nlesc-nano/nano-CAT@master --upgrade
pip install git+https://github.com/nlesc-nano/auto-FOX@master --upgrade
pip install git+https://github.com/SCM-NV/qmflows@master --upgrade
pip uninstall plams -y; pip install git+https://github.com/SCM-NV/PLAMS@master --upgrade
;;
*)
pip install -e .[test]
;;
esac
- name: Info Conda
if: matrix.conda == true
run: |
source $CONDA/bin/activate test
conda info
- name: Info Python
run: |
case "${{ matrix.conda }}" in
true)
source $CONDA/bin/activate test ;;
esac
which python
python --version
- name: Info installed packages
run: |
case "${{ matrix.conda }}" in
true)
conda list -n test ;;
*)
pip list ;;
esac
- name: Run tests
run: |
case "${{ matrix.conda }}" in
true)
source $CONDA/bin/activate test ;;
esac
pytest -m "not slow"
- name: Run codecov
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
name: codecov-umbrella
Linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python on ubuntu-latest
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install linters
run: |
pip install "flake8>=3.8.0" "pydocstyle>=5.0.0"
pip install -e .
pip install mypy nano-CAT data-CAT types-PyYAML types-setuptools "numpy>=1.21"
- name: Python info
run: |
which python
python --version
- name: Installed packages
run: pip list
- name: Run flake8
run: flake8 CAT tests
- name: Run pydocstyle
run: pydocstyle CAT tests
- name: Run mypy
run: mypy CAT
continue-on-error: true