Skip to content

Merge 'update_reqs_v2' into 'development' #1086

Merge 'update_reqs_v2' into 'development'

Merge 'update_reqs_v2' into 'development' #1086

Workflow file for this run

name: Unit test on push and PR
on:
push:
branches:
- main
- development
pull_request:
branches:
- main
- development
workflow_dispatch:
jobs:
unit-tests:
name: Run Unit Tests
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
env:
OS: ${{ matrix.os }}
PYTHON-VERSION: ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Checkout code
uses: actions/checkout@v3
- name: Get pip cache location
id: pip-cache
shell: bash
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Get date
id: date
shell: bash
run: >
python -c
"import datetime;
now = datetime.datetime.now();
print(f'text={now.year}/{now.month}-part{1 + now.day // 8}')" >> $GITHUB_OUTPUT
- name: Load pip Cache
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-Python${{ matrix.python-version }}-${{ steps.date.outputs.text }}-pip-${{ hashFiles('**/setup.py', './.github/workflows/unit-tests.yml') }}
- name: Install package & (test) dependencies
run: python -m pip install --upgrade --upgrade-strategy=eager .[test]
- name: Run Tests
run: >
python -m pytest tests
--cov=endaq
--cov-report=xml
--hypothesis-profile=ci
--numprocesses auto
-W error::RuntimeWarning
-W error::UserWarning
-W error::DeprecationWarning
- name: Generate Codecov Report
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON-VERSION
files: ./coverage.xml
name: ${{ matrix.os }} ${{ matrix.python-version }}
verbose: true