Skip to content

Commit 105f5e4

Browse files
Merge pull request #6 from OliverSchmitz/run-tests-in-ci
Added unit tests to CI
2 parents 75fbe0c + e74e407 commit 105f5e4

File tree

3 files changed

+38
-31
lines changed

3 files changed

+38
-31
lines changed

.github/workflows/main.yaml

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
name: Build and deploy
22

33
on:
4-
push:
5-
pull_request:
4+
pull_request:
5+
push:
6+
branches:
7+
- "master"
8+
workflow_dispatch:
69

710
env:
811
source-directory: $GITHUB_WORKSPACE
@@ -36,23 +39,40 @@ jobs:
3639
3740
- uses: conda-incubator/setup-miniconda@v3
3841
with:
39-
activate-environment: campo
40-
environment-file: environment/configuration/conda_environment.yaml
42+
activate-environment: campo_dev
43+
environment-file: environment/configuration/campo_dev.yaml
4144
python-version: 3.11
4245
auto-activate-base: false
4346

44-
- name: Build
47+
- name: Configure Campo
4548
shell: bash -l {0}
4649
run: |
4750
mkdir ${{ env.build-directory }}
51+
cmake \
52+
-S ${{ env.source-directory }} \
53+
-B ${{ env.build-directory }} \
54+
-D CAMPO_BUILD_WHEEL=ON
55+
56+
- name: Build Campo
57+
shell: bash -l {0}
58+
run: |
59+
cmake --build ${{ env.build-directory }} --target documentation
60+
cmake --build ${{ env.build-directory }} --target install
61+
rm -f ${{ env.build-directory }}/package/dist/*gz
62+
63+
- name: Test Campo
64+
shell: bash -l {0}
65+
run: |
66+
ctest --test-dir ${{ env.build-directory }} --output-on-failure
67+
68+
- name: Deploy documentation
69+
if: github.repository == 'computationalgeography/campo' && github.ref == 'refs/heads/master'
70+
run: |
4871
cd ${{ env.build-directory }}
49-
cmake ${{ env.source-directory }} -DCAMPO_BUILD_WHEEL=ON
50-
make documentation
51-
make install
52-
rm -f package/dist/*gz
72+
# lftp -c "open --user ${{ env.ftp_username }} --password ${{ env.ftp_password }} -p ${{ env.ftp_port }} ${{ env.ftp_server }};set sftp:auto-confirm yes;set ssl:verify-certificate false;mirror --verbose --reverse --continue --parallel=2 documentation/_build/ ${{ env.remote_dir1 }}"
5373
5474
- name: Deploy wheel
55-
if: github.repository == 'computationalgeography/campo'
75+
if: github.repository == 'computationalgeography/campo' && github.ref == 'refs/heads/master'
5676
run: |
5777
mkdir -p $HOME/.ssh
5878
echo "HostKeyAlgorithms ssh-rsa" >> $HOME/.ssh/config
@@ -61,14 +81,8 @@ jobs:
6181
cd ${{ env.build-directory }}
6282
lftp -c "open --user ${{ env.ftp_username }} --password ${{ env.ftp_password }} -p ${{ env.ftp_port }} ${{ env.ftp_server }};set sftp:auto-confirm yes;set ssl:verify-certificate false;mirror --verbose --reverse --continue package/dist/ ${{ env.remote_dir2 }}"
6383
64-
- name: Deploy documentation
65-
if: github.repository == 'computationalgeography/campo' && github.ref == 'refs/heads/master'
66-
run: |
67-
cd ${{ env.build-directory }}
68-
# lftp -c "open --user ${{ env.ftp_username }} --password ${{ env.ftp_password }} -p ${{ env.ftp_port }} ${{ env.ftp_server }};set sftp:auto-confirm yes;set ssl:verify-certificate false;mirror --verbose --reverse --continue --parallel=2 documentation/_build/ ${{ env.remote_dir1 }}"
69-
7084
- name: Deploy development documentation
71-
if: github.repository == 'computationalgeography/campo'
85+
if: github.repository == 'computationalgeography/campo' && github.ref == 'refs/heads/master'
7286
run: |
7387
cd ${{ env.build-directory }}
7488
lftp -c "open --user ${{ env.ftp_username }} --password ${{ env.ftp_password }} -p ${{ env.ftp_port }} ${{ env.ftp_server }};set sftp:auto-confirm yes;set ssl:verify-certificate false;mirror --verbose --reverse --continue --parallel=2 documentation/_build/ ${{ env.remote_dir3 }}"

environment/configuration/campo_dev.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ channels:
33
- conda-forge
44
- nodefaults
55
dependencies:
6-
- python=3.10
6+
- python=3.11
77
- numpy
88
- lue>0.3.6
9+
- hpx=1.9.0
10+
- pcraster
911
- sphinx=5.3
10-
- cmake
12+
- sphinx-autodoc-typehints
1113
- pandas
12-
# - hpx=1.9.0
13-
- pcraster
1414
- xarray
1515
- gdal
1616
- networkx
17-
- ipython
18-
17+
- cmake
18+
# - ipython

environment/configuration/conda_environment.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,9 @@ channels:
33
- conda-forge
44
- nodefaults
55
dependencies:
6-
- cmake
76
- python=3.11
87
- numpy
9-
- sphinx=5.3
10-
- sphinx-autodoc-typehints
11-
- pandas
128
- lue>0.3.6
139
- hpx=1.9.0
14-
- pcraster
15-
- xarray
16-
- gdal
17-
- networkx
10+
- campo
1811

0 commit comments

Comments
 (0)