Skip to content

feat: Run hooks on self and add really nice CLI output to README.md #57

feat: Run hooks on self and add really nice CLI output to README.md

feat: Run hooks on self and add really nice CLI output to README.md #57

Workflow file for this run

name: '[CI] Test'
on:
# Caches have a certain level of isolation, see https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
# We run on push to main to have all caches in the main branch so that they can be reused for PRs.
push:
branches:
- main
merge_group:
pull_request:
# Cancel a previous job if the same workflow is triggers on the same PR or commit.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: MyAlbum/purge-cache@6bd5afa0f99fd6096c4e08ed0eb1730da34d78dc # v2
with:
max-age: 604800 # Leave only caches accessed in the last 7 days (default)
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
id: cache-env
with:
path: |
./env
key: conda-env|${{ hashFiles('environment-dev.yml') }}
- name: Setup conda environment
if: steps.cache-env.outputs.cache-hit != 'true'
run: make setup
- name: Run static type check
run: make type-check
- name: Run tests
run: make test
- name: Report coverage
id: coverage
if: ${{ !cancelled() }}
uses: MishaKav/pytest-coverage-comment@a1fe18e2b00c64a765568e2edb9f1706eb8fc88b # v1.1.51
with:
title: Coverage Report
pytest-xml-coverage-path: ./coverage.xml