Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflows #88

Merged
merged 7 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
# Check for updates once a week
interval: 'weekly'
57 changes: 57 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Tests
on:
push:
branches:
- "main"
pull_request:
branches:
- "*"
schedule:
- cron: "0 13 * * 1"

jobs:
build:
name: Build (${{ matrix.python-version }} | ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache if ci/environment.yml has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/environment-py${{ matrix.python-version }}.yml') }}
- uses: conda-incubator/setup-miniconda@v2
with:
# mamba-version: "*" # activate this to build with mamba.
python-version: ${{ matrix.python-version }}
miniforge-variant: Mambaforge
channels: conda-forge, defaults # These need to be specified to use mamba
channel-priority: true
environment-file: ci/environment-py${{ matrix.python-version }}.yml

activate-environment: test_env_cmocean
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Set up conda environment
shell: bash -l {0}
run: |
python -m pip install -e . --no-deps --force-reinstall
- name: Run Tests
shell: bash -l {0}
run: |
pytest --cov=./ --cov-report=xml
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
14 changes: 14 additions & 0 deletions ci/environment-py3.10.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: test_env_cmocean
channels:
- conda-forge
dependencies:
- python=3.10
############## These will have to be adjusted to your specific project
- matplotlib-base
- numpy
##############
- pytest
- pip:
- codecov
- pytest-cov
- coverage[toml]
14 changes: 14 additions & 0 deletions ci/environment-py3.8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: test_env_cmocean
channels:
- conda-forge
dependencies:
- python=3.8
############## These will have to be adjusted to your specific project
- matplotlib-base
- numpy
##############
- pytest
- pip:
- codecov
- pytest-cov
- coverage[toml]
14 changes: 14 additions & 0 deletions ci/environment-py3.9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: test_env_cmocean
channels:
- conda-forge
dependencies:
- python=3.9
############## These will have to be adjusted to your specific project
- matplotlib-base
- numpy
##############
- pytest
- pip:
- codecov
- pytest-cov
- coverage[toml]
6 changes: 4 additions & 2 deletions docs/whats_new.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# What's New

## v0.3.0 (unreleased)
## v2.1.0 (unreleased)

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