Skip to content

tests: Update number of files expected in cache #43

tests: Update number of files expected in cache

tests: Update number of files expected in cache #43

Workflow file for this run

name: Tests
on:
push:
paths-ignore:
- .github/workflows/release.yml
pull_request:
paths-ignore:
- .github/workflows/release.yml
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Get pip cache
id: pip-cache
run: |
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
- name: pip cache
uses: actions/cache@v1
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dev dependencies
run: |
pip install -U pip setuptools wheel
pip install -e .[dev]
python -m pip freeze
- name: Build
run: |
python -m build .
unittest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Get pip cache
id: pip-cache
run: |
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
- name: pip cache
uses: actions/cache@v1
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dev dependencies
run: |
pip install -U pip setuptools wheel
pip install -e .[dev]
python -m pip freeze
- name: Test without coverage
if: ${{ matrix.python-version != '3.10' }}
run: |
python -m unittest discover -v
- name: Coverage Test
if: ${{ matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest' }}
run: |
python -m coverage run -m unittest discover -v
python -m coverage report -m
- name: Upload coverage to codecov
if: ${{ matrix.python-version == '3.10' && matrix.os == 'ubuntu-latest' }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
pip install -U codecov
codecov