Skip to content

Run tests

Run tests #596

Workflow file for this run

name: Run tests
on:
push:
branches: [latest]
pull_request:
schedule:
- cron: "0 0 * * *" # daily
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python: [3.9]
name: Python on ${{ matrix.python }}
steps:
- name: checkout
uses: actions/checkout@v4
# per https://github.com/conda-incubator/setup-miniconda#caching-environments
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: anaconda-client-env
use-mamba: true
python-version: ${{ matrix.python }}
- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
shell: bash
- name: Cache Conda env
uses: actions/cache@v3
with:
path: ${{ env.CONDA }}/envs
key:
conda-${{ runner.os }}--${{ runner.arch }}--${{
steps.get-date.outputs.today }}-${{
hashFiles('etc/example-environment-caching.yml') }}-${{ env.CACHE_NUMBER
}}
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
id: cache
- name: Update environment
run:
mamba env update -n anaconda-client-env -f environment.yml
if: steps.cache.outputs.cache-hit != 'true'
# - name: Install coverage dependencies
# run: python -m pip install pytest-cov
- name: Show Python version
shell: bash -el {0}
run: python -V
- name: Conda info
shell: bash -el {0}
run: conda info
- name: Conda list
shell: bash -el {0}
run: conda list
- name: Install grist
shell: bash -el {0}
run: python -m pip install -e .
- name: Install grist test deps
shell: bash -el {0}
run: python -m pip install -e .[test]
# - run: pip check
- run: pytest tests
shell: bash -el {0}
# - run: pytest tests --cov=.
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v1