-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (80 loc) · 2.28 KB
/
mambatest.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
83
84
85
# This workflow will install Python dependencies using Mamba,
# run tests and lint with a single version of Python
name: mamba-test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
schedule:
- cron: "0 2 * * 1" #run every Monday night at 2AM UTC
permissions:
contents: read
jobs:
mamba-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
#python-version: ["3.11"]
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v4
- name: provision-with-micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-name: ecmean
cache-downloads: true
cache-environment: true
post-cleanup: environment
condarc: |
channels:
- conda-forge
create-args: >-
python=${{ matrix.python-version }}
- name: Install Flake8
run: |
python -m pip install flake8
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude=__init__.py
- name: Install Pytest
run: |
python -m pip install pytest
- name: Test with pytest
run: |
python -m pytest
coverage:
needs: mamba-test
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v3
- name: provision-with-micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment.yml
environment-name: ecmean
- name: Install Coverage
run: |
python -m pip install pytest coverage coveralls
- name: Run coverage
run: |
coverage run -m pytest
coverage combine
coverage lcov
- name: Run coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov