From 176cc94ae7ce2e713938375cf7172b01d96704a2 Mon Sep 17 00:00:00 2001 From: Oliver Schmitz Date: Tue, 5 Nov 2024 12:04:15 +0100 Subject: [PATCH] Added unit tests to CI --- .github/workflows/main.yaml | 27 +++++++++++++------ environment/configuration/campo_dev.yaml | 12 ++++----- .../configuration/conda_environment.yaml | 9 +------ 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c83ec81..4a39e1f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -36,20 +36,31 @@ jobs: - uses: conda-incubator/setup-miniconda@v3 with: - activate-environment: campo - environment-file: environment/configuration/conda_environment.yaml + activate-environment: campo_dev + environment-file: environment/configuration/campo_dev.yaml python-version: 3.11 auto-activate-base: false - - name: Build + - name: Configure Campo shell: bash -l {0} run: | mkdir ${{ env.build-directory }} - cd ${{ env.build-directory }} - cmake ${{ env.source-directory }} -DCAMPO_BUILD_WHEEL=ON - make documentation - make install - rm -f package/dist/*gz + cmake \ + -S ${{ env.source-directory }} \ + -B ${{ env.build-directory }} \ + -D CAMPO_BUILD_WHEEL=ON + + - name: Build Campo + shell: bash -l {0} + run: | + cmake --build ${{ env.build-directory }} --target documentation + cmake --build ${{ env.build-directory }} --target install + rm -f ${{ env.build-directory }}/package/dist/*gz + + - name: Test Campo + shell: bash -l {0} + run: | + ctest --test-dir ${{ env.build-directory }} --output-on-failure - name: Deploy wheel if: github.repository == 'computationalgeography/campo' diff --git a/environment/configuration/campo_dev.yaml b/environment/configuration/campo_dev.yaml index f686b71..856cd34 100644 --- a/environment/configuration/campo_dev.yaml +++ b/environment/configuration/campo_dev.yaml @@ -3,16 +3,16 @@ channels: - conda-forge - nodefaults dependencies: - - python=3.10 + - python=3.11 - numpy - lue>0.3.6 + - hpx=1.9.0 + - pcraster - sphinx=5.3 - - cmake + - sphinx-autodoc-typehints - pandas -# - hpx=1.9.0 - - pcraster - xarray - gdal - networkx - - ipython - + - cmake + # - ipython diff --git a/environment/configuration/conda_environment.yaml b/environment/configuration/conda_environment.yaml index e1f1fef..dbb3db4 100644 --- a/environment/configuration/conda_environment.yaml +++ b/environment/configuration/conda_environment.yaml @@ -3,16 +3,9 @@ channels: - conda-forge - nodefaults dependencies: - - cmake - python=3.11 - numpy - - sphinx=5.3 - - sphinx-autodoc-typehints - - pandas - lue>0.3.6 - hpx=1.9.0 - - pcraster - - xarray - - gdal - - networkx + - campo