-
Notifications
You must be signed in to change notification settings - Fork 6
89 lines (71 loc) · 2.21 KB
/
run_tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
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@v3
# 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