Skip to content

Commit 99e1396

Browse files
authored
Merge pull request #88 from kthyng/workflows
Workflows
2 parents 7dc88d8 + 68e8e55 commit 99e1396

File tree

6 files changed

+110
-2
lines changed

6 files changed

+110
-2
lines changed

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: 'github-actions'
4+
directory: '/'
5+
schedule:
6+
# Check for updates once a week
7+
interval: 'weekly'

.github/workflows/test.yaml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
7+
branches:
8+
- "*"
9+
schedule:
10+
- cron: "0 13 * * 1"
11+
12+
jobs:
13+
build:
14+
name: Build (${{ matrix.python-version }} | ${{ matrix.os }})
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
20+
python-version: ["3.8", "3.9", "3.10"]
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Cache conda
24+
uses: actions/cache@v3
25+
env:
26+
# Increase this value to reset cache if ci/environment.yml has not changed
27+
CACHE_NUMBER: 0
28+
with:
29+
path: ~/conda_pkgs_dir
30+
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-py${{ matrix.python-version }}.yml') }}
31+
- uses: conda-incubator/setup-miniconda@v2
32+
with:
33+
# mamba-version: "*" # activate this to build with mamba.
34+
python-version: ${{ matrix.python-version }}
35+
miniforge-variant: Mambaforge
36+
channels: conda-forge, defaults # These need to be specified to use mamba
37+
channel-priority: true
38+
environment-file: ci/environment-py${{ matrix.python-version }}.yml
39+
40+
activate-environment: test_env_cmocean
41+
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
42+
- name: Set up conda environment
43+
shell: bash -l {0}
44+
run: |
45+
python -m pip install -e . --no-deps --force-reinstall
46+
- name: Run Tests
47+
shell: bash -l {0}
48+
run: |
49+
pytest --cov=./ --cov-report=xml
50+
- name: Upload code coverage to Codecov
51+
uses: codecov/codecov-action@v3
52+
with:
53+
file: ./coverage.xml
54+
flags: unittests
55+
env_vars: OS,PYTHON
56+
name: codecov-umbrella
57+
fail_ci_if_error: false

ci/environment-py3.10.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: test_env_cmocean
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.10
6+
############## These will have to be adjusted to your specific project
7+
- matplotlib-base
8+
- numpy
9+
##############
10+
- pytest
11+
- pip:
12+
- codecov
13+
- pytest-cov
14+
- coverage[toml]

ci/environment-py3.8.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: test_env_cmocean
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.8
6+
############## These will have to be adjusted to your specific project
7+
- matplotlib-base
8+
- numpy
9+
##############
10+
- pytest
11+
- pip:
12+
- codecov
13+
- pytest-cov
14+
- coverage[toml]

ci/environment-py3.9.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: test_env_cmocean
2+
channels:
3+
- conda-forge
4+
dependencies:
5+
- python=3.9
6+
############## These will have to be adjusted to your specific project
7+
- matplotlib-base
8+
- numpy
9+
##############
10+
- pytest
11+
- pip:
12+
- codecov
13+
- pytest-cov
14+
- coverage[toml]

docs/whats_new.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# What's New
22

3-
## v0.3.0 (unreleased)
3+
## v2.1.0 (unreleased)
44

55
* Fixed a deprecation warning (https://github.com/matplotlib/cmocean/pull/86), by @neutrinoceros
6-
* Added CodeQL workflow (https://github.com/matplotlib/cmocean/pull/85), by bot
6+
* Added CodeQL workflow (https://github.com/matplotlib/cmocean/pull/85), by bot
7+
* Changed master to main, by @kthyng
8+
* Added new CI workflows (testing, dependabot) and added codecov (https://github.com/matplotlib/cmocean/pull/88), by @kthyng

0 commit comments

Comments
 (0)