[5d12a0]: / .github / workflows / ci-pytest.yml

Download this file

57 lines (49 with data), 1.6 kB

 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
name: ci-pytest
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
env:
# Updates or changes to this, or the runner OS or arch will invalidate the cache
python_version: "3.12" # Python version to use for testing - update when needed
jobs:
test:
runs-on: ubuntu-22.04
# Default shell needs to be bash for conda
# https://github.com/conda-incubator/setup-miniconda?tab=readme-ov-file#important
defaults:
run:
shell: bash -el {0}
steps:
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@505e6394dae86d6a5c7fbb6e3fb8938e3e863830 # v3.1.1, devs recommend using hash
with:
miniforge-version: latest
python-version: ${{ env.python_version }}
auto-update-conda: true
activate-environment: "test-env"
- name: Checkout code
uses: actions/checkout@v4 # Checkout PR code to 'antspy-pr'
with:
path: antspy-pr
- name: Install dependencies and ANTsPy from PR
run: |
conda info
conda create -n antspy-env python=${{ env.python_version }} -y
conda activate antspy-env
conda install coverage
conda info
pip install ./antspy-pr
conda list
- name: Run tests
run: |
conda activate antspy-env
bash antspy-pr/tests/run_tests.sh -c
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
files: antspy-pr/tests/coverage.xml