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

TST: GitHub actions #45

Merged
merged 23 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from 22 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
42 changes: 42 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Documentation Check

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.9]

name: Documentation tests
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r test_requirements.txt
pip install -r requirements.txt

- name: Set up pysat
run: |
mkdir pysatData
python -c "import pysat; pysat.params['data_dirs'] = './pysatData'"

- name: Check documentation build
run: sphinx-build -E -b html docs dist/docs

- name: Check documentation links
run: sphinx-build -b linkcheck docs dist/docs

- name: Load .zenodo.json to check for errors
run: python -c "import json; json.loads(open('.zenodo.json').read())"
59 changes: 59 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Pytest with Flake8

on: [push, pull_request]

jobs:
build:

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10"]
numpy_ver: ["latest"]
include:
- python-version: "3.8"
numpy_ver: "1.19"
os: ubuntu-latest

name: Python ${{ matrix.python-version }} on ${{ matrix.os }} with numpy ${{ matrix.numpy_ver }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install standard dependencies
run: |
python -m pip install --upgrade pip
jklenzing marked this conversation as resolved.
Show resolved Hide resolved
pip install -r test_requirements.txt
pip install -r requirements.txt;

- name: Install NEP29 dependencies
if: ${{ matrix.numpy_ver != 'latest'}}
run: |
pip install --no-binary :numpy: numpy==${{ matrix.numpy_ver }}

- name: Set up pysat
run: |
mkdir pysatData
python -c "import pysat; pysat.params['data_dirs'] = 'pysatData'"

- name: Test PEP8 compliance
run: flake8 . --count --select=E,F,W --show-source --statistics

- name: Evaluate complexity
run: flake8 . --count --exit-zero --max-complexity=10 --statistics

- name: Test with pytest
run: pytest --cov=pysatMadrigal/

- name: Publish results to coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --rcfile=setup.cfg --service=github
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).

## [0.0.4] - 2021-06-11
- Made changes to structure to comply with updates in pysat 3.0.0
- Migrated CI tests from Travis CI to GitHub Actions
- Deprecations
- Restructed Instrument methods, moving `madrigal` to `general` and extracting
local methods from the instrument modules to platform-specific method files
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# pysatMadrigal
[![Documentation Status](https://readthedocs.org/projects/pysatmadrigal/badge/?version=latest)](https://pysatmadrigal.readthedocs.io/en/latest/?badge=latest)
[![Build Status](https://travis-ci.org/pysat/pysatMadrigal.svg?branch=main)](https://travis-ci.com/pysat/pysatMadrigal)
[![Build Status](https://github.com/github/docs/actions/workflows/main.yml/badge.svg)](https://github.com/github/docs/actions/workflows/main.yml/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/pysat/pysatMadrigal/badge.svg?branch=main)](https://coveralls.io/github/pysat/pysatMadrigal?branch=main)
[![DOI](https://zenodo.org/badge/258384773.svg)](https://zenodo.org/badge/latestdoi/258384773)
[![PyPI version](https://badge.fury.io/py/pysatMadrigal.svg)](https://badge.fury.io/py/pysatMadrigal)
Expand Down
10 changes: 2 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,10 @@ setup_requires = setuptools >= 38.6; pip >= 10
include_package_data = True
zip_safe = False
packages = find:
install_requires = h5py
madrigalWeb
numpy
pandas
pysat
xarray
install_requires = file: requirements.txt
jklenzing marked this conversation as resolved.
Show resolved Hide resolved

[coverage:report]
omit = */instruments/templates/
omit = */instruments/templates/*

[flake8]
max-line-length = 80
Expand All @@ -62,4 +57,3 @@ markers =
no_download: tests for instruments without download support
first: first tests to run
second: second tests to run

2 changes: 1 addition & 1 deletion test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
coveralls
coveralls<3.3
flake8
m2r2
numpydoc
Expand Down