Skip to content

Commit cc268c3

Browse files
authored
Use GitHub Actions for continous integration (#39)
* Set up skeleton CI action * Try mamba * Build babelizer and show diagnostics * Make C example * Test language examples * Extend tests to macOS and py39 * Replace references to Travis CI * Update changelog
1 parent d696e52 commit cc268c3

File tree

5 files changed

+116
-87
lines changed

5 files changed

+116
-87
lines changed

.github/workflows/build-test-ci.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
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]
16+
python-version: [3.8, 3.9]
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
with:
21+
submodules: true
22+
23+
- uses: conda-incubator/setup-miniconda@v2
24+
with:
25+
auto-update-conda: true
26+
python-version: ${{ matrix.python-version }}
27+
mamba-version: "*"
28+
channels: conda-forge
29+
channel-priority: true
30+
31+
- name: Install dependencies
32+
run: |
33+
mamba install --file=requirements.txt --file=requirements-testing.txt
34+
conda list
35+
36+
- name: Install babelizer
37+
run: |
38+
pip install .
39+
40+
- name: Run diagnostics
41+
run: |
42+
babelize --version
43+
babelize --help
44+
babelize init --help
45+
babelize update --help
46+
babelize generate --help
47+
babelize generate - --no-input
48+
python -c 'import babelizer; print(babelizer.__version__)'
49+
50+
- name: Make C example
51+
run: |
52+
mkdir buildc && pushd buildc
53+
cmake ../external/bmi-example-c -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
54+
make install
55+
popd
56+
57+
- name: Make C++ example
58+
run: |
59+
mkdir buildcxx && pushd buildcxx
60+
cmake ../external/bmi-example-cxx -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
61+
make install
62+
popd
63+
64+
- name: Make Fortran example
65+
run: |
66+
mkdir buildf && pushd buildf
67+
cmake ../external/bmi-example-fortran -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX
68+
make install
69+
popd
70+
71+
- name: Make Python example
72+
run: |
73+
pushd ./external/bmi-example-python
74+
make install
75+
popd
76+
77+
- name: Test language examples
78+
run: |
79+
pytest -vvv
80+
81+
lint:
82+
runs-on: ubuntu-latest
83+
84+
steps:
85+
- uses: actions/checkout@v2
86+
87+
- name: Set up Python 3.8
88+
uses: actions/setup-python@v2
89+
with:
90+
python-version: 3.8
91+
92+
- name: Lint
93+
run: |
94+
pip install flake8
95+
make lint
96+
97+
docs:
98+
runs-on: ubuntu-latest
99+
100+
steps:
101+
- uses: actions/checkout@v2
102+
103+
- name: Set up Python 3.8
104+
uses: actions/setup-python@v2
105+
with:
106+
python-version: 3.8
107+
108+
- name: Build docs
109+
run: |
110+
pip install -r requirements.txt -r requirements-docs.txt
111+
pip install -e .
112+
make -C docs clean html

.travis.yml

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

CHANGES.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Changelog for babelizer
44
0.3.7 (unreleased)
55
------------------
66

7-
- Nothing changed yet.
7+
- Use GitHub Actions for continuous integration (#39)
88

99

1010
0.3.6 (2021-01-13)

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Before you submit a pull request, check that it meets these guidelines:
106106
your new functionality into a function with a docstring, and add the
107107
feature to the list in README.rst.
108108
3. The pull request need only work with Python >= 3.8. Check
109-
https://travis-ci.org/csdms/babelizer/pull_requests
109+
https://github.com/csdms/babelizer/actions
110110
and make sure that the tests pass.
111111

112112
Deploying

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
.. image:: https://travis-ci.com/csdms/babelizer.svg?branch=develop
2-
:target: https://travis-ci.com/csdms/babelizer
1+
.. image:: https://github.com/csdms/babelizer/workflows/Build/Test%20CI/badge.svg
2+
:target: https://github.com/csdms/babelizer/actions?query=workflow%3A%22Build%2FTest+CI%22
33

44
.. image:: https://readthedocs.org/projects/babelizer/badge/?version=latest
55
:target: https://babelizer.readthedocs.io/en/latest/?badge=latest

0 commit comments

Comments
 (0)