-
Notifications
You must be signed in to change notification settings - Fork 134
55 lines (46 loc) · 1.43 KB
/
test.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
name: Test
on:
push:
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.9]
steps:
- name: Checkout nglview repository
uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v3
env:
CACHE_NUMBER: 2 # Increase this value to reset cache if .github/nglview-gha.yml has not changed
with:
path: ~/conda_pkgs_dir
key:
${{ matrix.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.github/nglview-gha.yml') }}
- name: Set up conda environment
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
auto-activate-base: false
activate-environment: nglview-gha
environment-file: .github/nglview-gha.yml
mamba-version: "*"
channels: conda-forge
channel-priority: true
python-version: ${{ matrix.python-version }}
use-only-tar-bz2: false # https://github.com/conda-incubator/setup-miniconda/issues/264
- name: Run tests
run: |
python -m pytest -vs nglview/tests --cov=nglview --cov-report=html --disable-pytest-warnings
- name: Check installation with pip
run: |
python setup.py sdist
pip install dist/*gz
python -c "import nglview as nv; print(nv.__version__)"