Skip to content

Commit e6b1e91

Browse files
authored
Use GitHub Actions for continuous integration (#15)
* Add GitHub Actions workflow for continuous integration * Add repo token * Try coveralls app * Try coveralls-python * Run coverage on Linux only * Enable macOS, but only test coverage on Linux, once * Try if before uses statement * Use runner instead of matrix * No quotes * How about single quotes * Try matrix again, with single quotes * Test coverage only on py38 * Try Windows * Remove Travis CI workflow
1 parent 9c7c03f commit e6b1e91

4 files changed

Lines changed: 70 additions & 63 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Build/Test CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build-and-test:
7+
runs-on: ${{ matrix.os }}
8+
9+
defaults:
10+
run:
11+
shell: bash -l {0}
12+
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
python-version: [3.8, 3.9]
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
21+
- uses: conda-incubator/setup-miniconda@v2
22+
with:
23+
auto-update-conda: true
24+
python-version: ${{ matrix.python-version }}
25+
channels: conda-forge
26+
channel-priority: true
27+
28+
- name: Show conda installation info
29+
run: conda info
30+
31+
- name: Install dependencies
32+
run: |
33+
conda install --file=requirements.txt -c conda-forge
34+
conda list
35+
36+
- name: Build and install package
37+
run: pip install .
38+
39+
- name: Install testing dependencies
40+
run: conda install --file=requirements-testing.txt -c conda-forge
41+
42+
- name: Test
43+
run: |
44+
pytest --cov=heat --cov-report=xml:./coverage.xml -vvv
45+
bmi-test heat:BmiHeat --config-file=./examples/heat.yaml --root-dir=./examples -vvv
46+
47+
- name: Coveralls
48+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
49+
uses: AndreMiras/coveralls-python-action@v20201129
50+
51+
lint:
52+
runs-on: ubuntu-latest
53+
54+
steps:
55+
- uses: actions/checkout@v2
56+
57+
- name: Set up Python 3.8
58+
uses: actions/setup-python@v2
59+
with:
60+
python-version: 3.8
61+
62+
- name: Lint
63+
run: |
64+
pip install flake8
65+
make lint

.travis.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
:target: https://bmi.readthedocs.io/
33
:alt: Basic Model Interface
44

5-
.. image:: https://travis-ci.org/csdms/bmi-example-python.svg?branch=master
6-
:target: https://travis-ci.org/csdms/bmi-example-python
5+
.. image:: https://github.com/csdms/bmi-example-python/workflows/Build/Test%20CI/badge.svg
6+
:target: https://github.com/csdms/bmi-example-python/actions?query=workflow%3A%22Build%2FTest+CI%22
77

88
.. image:: https://coveralls.io/repos/csdms/bmi-example-python/badge.png?branch=master
99
:target: https://coveralls.io/r/csdms/bmi-example-python?branch=master

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ doctest_optionflags =
2323
IGNORE_EXCEPTION_DETAIL
2424
ALLOW_UNICODE
2525

26+
[coverage:run]
27+
relative_files = True
28+
2629
[isort]
2730
multi_line_output=3
2831
include_trailing_comma=True

0 commit comments

Comments
 (0)