-
-
Notifications
You must be signed in to change notification settings - Fork 1
108 lines (97 loc) · 2.97 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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: ${{ matrix.os }} - Python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
os: [ubuntu-latest]
timeout-minutes: 30
defaults:
run:
shell: bash -l {0}
steps:
# Checkout current git repository
- name: Checkout
uses: actions/checkout@v4.0.0
with:
# fetch all history so that setuptools-scm works
fetch-depth: 0
# Install Mambaforge with conda-forge dependencies
- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2.2.0
with:
activate-environment: carbonplan-project-tests
python-version: ${{ matrix.python-version }}
channels: conda-forge,nodefaults
channel-priority: strict
miniforge-version: latest
miniforge-variant: Mambaforge
mamba-version: '*'
run-post: false
use-mamba: true
- name: Install dependencies
run: |
mamba install pytest pytest-cov pytest-mypy
- name: List installed packages
run: mamba list
- name: Install package
run: |
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip list
- name: Tests # run tests (includes mypy checks and coverage export)
run: |
python -m pytest
# - name: Upload coverage to Codecov # this automatically hooks up to Codecov
# uses: codecov/codecov-action@v3.1.1
# if: ${{ matrix.python-version }} == 3.10
# with:
# file: ./coverage.xml
# fail_ci_if_error: false
# docker:
# runs-on: ubuntu-latest
# strategy:
# fail-fast: flase
# matrix:
# image:
# - python-notebook
# - R-notebook
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Docker meta
# id: docker_meta
# uses: crazy-max/ghaction-docker-meta@v2.3.0
# with:
# images: |
# carbonplan/forests-${{matrix.image}}
# tag-sha: true
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v1
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
# - name: Login to DockerHub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# - name: Build and push
# uses: docker/build-push-action@v2
# with:
# context: envs/${{matrix.image}}
# push: ${{ github.event_name != 'pull_request' }}
# tags: ${{ steps.docker_meta.outputs.tags }}
# labels: ${{ steps.docker_meta.outputs.labels }}