Skip to content

Test Duration Logger #13

Test Duration Logger

Test Duration Logger #13

name: Test Duration Logger
on: [workflow_dispatch]
jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
max-parallel: 1
matrix:
python-version: ['3.8']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install dependencies (pip)
run: |
pip install wheel
pip install -r requirements.txt
pip install -r requirements/tests.txt
- name: Running unit tests and examples
run: |
rm test/fixtures/.test_durations*
pytest \
--nbval-lax examples/ \
--store-durations \
--durations-path test/fixtures/.test_durations_examples
pytest test/ \
--store-durations \
--durations-path test/fixtures/.test_durations_unit
- name: Committing test duration files
uses: EndBug/add-and-commit@v7
with:
add: 'test/fixtures'
author_name: github-actions
author_email: 41898282+github-actions[bot]@users.noreply.github.com
message: 'Updated test duration files.'