-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (66 loc) · 2.25 KB
/
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Run CI tests
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
PY_VERSION: "3.10"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
conda-build:
name: Conda Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup conda environment
uses: conda-incubator/setup-miniconda@11b562958363ec5770fef326fe8ef0366f8cbf8a # v3.0.1
with:
miniconda-version: "latest"
python-version: ${{ env.PY_VERSION }}
environment-file: conda/environment.yml
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true
- name: Run conda build
shell: bash -el {0}
run: conda build . --no-anaconda-upload
tests:
name: Tests
runs-on: ubuntu-latest
# Run the job for different versions of python
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Setup conda environment
uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}
- name: Install source
shell: bash -l {0}
run: python -m pip install -e .
- name: List installed packages
shell: bash -l {0}
run: conda list
- name: Lint
run: pylint --extension-pkg-whitelist=netCDF4 --ignored-modules=backports -E umpost
- name: Run tests
shell: bash -l {0}
run: python -m pytest --cov=umpost --cov-report=xml -s test
- name: Upload code coverage
uses: codecov/codecov-action@v4
# Only upload once for the installed version
if: matrix.python-version == ${{ env.PY_VERSION }}
with:
token: ${{ secrets.codecov_token }}
files: ./coverage.xml