-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (55 loc) · 1.76 KB
/
python-ci.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
name: Python CI
on:
push:
branches: [ main ]
# When this workflow is queued, automatically cancel any previous running
# or pending jobs from the same branch
concurrency:
group: conda-${{ github.ref }}
cancel-in-progress: true
# Required shell entrypoint to have properly activated conda environments
defaults:
run:
shell: bash -l {0}
jobs:
build:
strategy:
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10"]
runs-on: "${{ matrix.os }}"
steps:
- uses: actions/checkout@v4
- name: "Cache conda"
uses: "actions/cache@v1"
env:
# Increase this value to reset cache if env.yml has not changed
CACHE_NUMBER: 0
with:
path: "~/conda_pkgs_dir"
key: "${{ matrix.os }}-conda-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('enviroment.yml') }}"
- name: Set up Python ${{ matrix.python-version }}
uses: conda-incubator/[email protected]
with:
miniforge-version: latest
use-mamba: true
python-version: ${{ matrix.python-version }}
channel-priority: strict
environment-file: environment.yml
activate-environment: "zarrcade"
- name: Review dependencies
run: |
which python
pip list
mamba list
- name: Test with pytest
run: |
python -m pytest -W ignore::DeprecationWarning
#python -m pytest --cov=zarrcade --cov-report=html --cov-report=term -W ignore::DeprecationWarning --html=htmlcov/test_results.html
- name: Upload pytest and coverage results
uses: actions/upload-artifact@v4
if: always()
with:
name: testcoverage-${{ matrix.os }}-py${{ matrix.python-version }}
path: |
htmlcov/*