generated from carbonplan/python-project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 6
55 lines (51 loc) · 1.33 KB
/
main.yaml
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: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # Daily “At 00:00”
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
if: github.repository == 'carbonplan/ndpyramid'
name: ${{ matrix.python-version }}-build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10'] #TODO: add 3.11 once sparse/numba support it
timeout-minutes: 20
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- name: Install Conda environment from environment.yml
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: ci/environment.yml
cache-downloads: true
extra-specs: |
python=${{ matrix.python-version }}
- name: Install package
run: |
python -m pip install -e . --no-deps
- name: Conda list information
run: |
conda env list
conda list
- name: Run tests
run: |
python -m pytest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
fail_ci_if_error: false