Skip to content

Commit

Permalink
Swap travis for GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
sverhoeven committed Aug 11, 2020
1 parent cb639df commit 8c2a915
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 79 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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: CI

on:
push:
pull_request:

jobs:
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python setup.py install
- name: Setup Singularity
uses: eWaterCycle/setup-singularity@v3
with:
singularity-version: 3.5.3
- name: Pull Docker image
run: docker pull ewatercycle/walrus-grpc4bmi:v0.2.0
- name: Cache Singularity image
id: cache-singularity-image
uses: actions/cache@v2
with:
path: ~/.singularity
key: singularity-image
- name: Pull Singularity image
if: steps.cache-singularity-image.outputs.cache-hit != 'true'
run: singularity pull docker://ewatercycle/walrus-grpc4bmi:v0.2.0
- name: Test with pytest
run: pytest --cov=grpc4bmi --cov-report xml
- name: Correct coverage paths
run: sed -i "s+$PWD/++g" coverage.xml
- name: SonarCloud analysis
uses: sonarsource/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
cpp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install grpc
uses: ewatercycle/setup-grpc@master
with:
grpc-version: 1.27.2
- name: Copy grpc to system default
run: |
sudo rsync -a $GRPC_ROOT/ /usr/local
sudo ldconfig
- name: Build dir
run: mkdir -p cpp/build
- name: configure
run: cmake ..
working-directory: cpp/build
- name: make
run: make VERBOSE=1
working-directory: cpp/build
- name: ctest
run: ctest -V
working-directory: cpp/build
70 changes: 0 additions & 70 deletions .travis.yml

This file was deleted.

20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# grpc4bmi

[![DOI](https://zenodo.org/badge/130237165.svg)](https://zenodo.org/badge/latestdoi/130237165)
[![Build Status](https://travis-ci.org/eWaterCycle/grpc4bmi.svg?branch=master)](https://travis-ci.org/eWaterCycle/grpc4bmi)
[![CI](https://github.com/eWaterCycle/grpc4bmi/workflows/CI/badge.svg)](https://github.com/eWaterCycle/grpc4bmi/actions?query=workflow%3ACI)
[![Documentation Status](https://readthedocs.org/projects/grpc4bmi/badge/?version=latest)](https://grpc4bmi.readthedocs.io/en/latest/?badge=latest)

# grpc4bmi
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=grpc4bmi&metric=alert_status)](https://sonarcloud.io/dashboard?id=grpc4bmi)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=grpc4bmi&metric=coverage)](https://sonarcloud.io/dashboard?id=grpc4bmi)

## Purpose

Expand Down Expand Up @@ -35,10 +37,10 @@ For inspiration look at the example in the test directory. To start a server pro
```bash
run-bmi-server --name <PACKAGE>.<MODULE>.<CLASS> --port <PORT> --path <PATH>
```
where ```<PACKAGE>, <MODULE>``` are the python package and module containing your implementation, ```<CLASS>``` is your
bmi model class name, ```<PORT>``` is any available port on the host system, and optionally ```<PATH>``` denotes an
additional path that should be added to the system path to make your implementation work. The name option above is
optional, and if not provided the script will look at the environment variables ```BMI_PACKAGE```, ```BMI_MODULE``` and
where ```<PACKAGE>, <MODULE>``` are the python package and module containing your implementation, ```<CLASS>``` is your
bmi model class name, ```<PORT>``` is any available port on the host system, and optionally ```<PATH>``` denotes an
additional path that should be added to the system path to make your implementation work. The name option above is
optional, and if not provided the script will look at the environment variables ```BMI_PACKAGE```, ```BMI_MODULE``` and
```BMI_CLASS```. Similarly, the port can be defined by the environment variable ```BMI_PORT```.
This software assumes that your implementation constructor has no parameters.

Expand Down Expand Up @@ -77,7 +79,7 @@ mymodel.initialize(<FILEPATH>)
...further BMI calls...
```

The package contains also client implementation that own the server process, either as a python subprocess or a docker
The package contains also client implementation that own the server process, either as a python subprocess or a docker
image or a singularity image running the ```run-bmi-server``` script. For instance
```python
from grpc4bmi.bmi_client_subproc import BmiClientSubProcess
Expand Down Expand Up @@ -109,7 +111,7 @@ pip install -e .[R]

```
and install the C++ runtime and `protoc` command as described in <https://github.com/google/protobuf/blob/master/src/README.md>.
After this, simply executing the `proto_gen.sh` script should do the job.
After this, simply executing the `proto_gen.sh` script should do the job.

## Future work

Expand Down

0 comments on commit 8c2a915

Please sign in to comment.