-
Notifications
You must be signed in to change notification settings - Fork 4
99 lines (96 loc) · 2.99 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# 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:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
jobs:
python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r dev-requirements.txt
pip install -e .[R,julia]
- name: Setup Apptainer
uses: eWaterCycle/setup-apptainer@v2
with:
apptainer-version: 1.1.9
- name: Pull Docker image
run: docker pull ewatercycle/walrus-grpc4bmi:v0.3.1
- name: Cache Apptainer image
id: cache-apptainer-image
uses: actions/cache@v3
with:
path: ~/.apptainer
key: apptainer-image
- name: Pull Apptainer image
if: steps.cache-apptainer-image.outputs.cache-hit != 'true'
run: apptainer pull docker://ewatercycle/walrus-grpc4bmi:v0.3.1
- uses: r-lib/actions/setup-r@v2
with:
install-r: false
- name: Install R dependencies
run: |
Rscript -e "install.packages('remotes')"
Rscript -e "install.packages('R6')"
- name: Install Julia
uses: julia-actions/setup-julia@v1
with:
version: '^1.9'
- name: Test with pytest
run: |
pytest -vv --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-22.04
steps:
- uses: actions/checkout@v3
- name: Install grpc
uses: ewatercycle/setup-grpc@v4
with:
grpc-version: 1.51.1
- name: Copy grpc to system default
run: |
sudo rsync -a $GRPC_ROOT/ /usr/local
sudo ldconfig
- name: Install bmi-cxx
run: |
git clone -b v2.0 https://github.com/csdms/bmi-cxx.git bmi-cxx
mkdir bmi-cxx/build
cd bmi-cxx/build
cmake ..
make install
- name: Install bmi-cxx
run: |
git clone -b v2.1 https://github.com/csdms/bmi-c.git bmi-c
mkdir bmi-c/build
cd bmi-c/build
cmake ..
make install
- 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
# TODO use https://github.com/marketplace/actions/sonarcloud-scan-for-c-and-c