From 969779fde97df907e5f79619ae1ddafbdcfafb23 Mon Sep 17 00:00:00 2001 From: "j.belina" Date: Fri, 23 Feb 2024 16:25:49 +0100 Subject: [PATCH] Add test for fine geokit, glaes. Fix version tag for fine --- .github/workflows/test_combined.yml | 22 +-- .github/workflows/test_fine_geokit.yml | 7 +- .github/workflows/test_fine_geokit_glaes.yml | 135 +++++++++++++++++++ .github/workflows/test_geokit_comp.yml | 4 +- 4 files changed, 154 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/test_fine_geokit_glaes.yml diff --git a/.github/workflows/test_combined.yml b/.github/workflows/test_combined.yml index e2d2563..328a40d 100644 --- a/.github/workflows/test_combined.yml +++ b/.github/workflows/test_combined.yml @@ -22,7 +22,7 @@ on: jobs: TestCombinedInstalaltions: - name: Ex1 (${{ matrix.python-version }}, ${{ matrix.os }}) + name: Test on ${{ matrix.os }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -49,32 +49,38 @@ jobs: shell: pwsh id: fine-version run: | - $FINE_STRING = conda list -e -n test_env fine | Out-String - echo The fine string is $FINE_STRING - FINE_VERSION = [regex]::Match($FINE_STRING, 'fine=(\d+\.\d+\.\d+)=').Groups[1].Value - echo "FINE_VERSION=$FINE_VERSION" >> $GITHUB_OUTPUT + $FINE_STRING = conda list -e -n test_env fine | Out-String + echo the fine string is $FINE_STRING + $FINE_VERSION = [regex]::Match($FINE_STRING, 'fine=(\d+\.\d+\.\d+)=').Groups[1].Value + echo "FINE_VERSION=$FINE_VERSION" >> $GITHUB_OUTPUT + echo fine version: $FINE_VERSION - name: Get fine version shell: pwsh id: other-version run: | $GEOKIT_STRING = conda list -e -n test_env geokit | Out-String - echo The Geokit string is $GEOKIT_STRING + echo The geokit string is $GEOKIT_STRING $GEOKIT_VERSION = [regex]::Match($GEOKIT_STRING, 'geokit=(\d+\.\d+\.\d+)=').Groups[1].Value echo "GEOKIT_VERSION=$GEOKIT_VERSION" >> $GITHUB_OUTPUT + echo Geokit version: $GEOKIT_VERSION $GLAES_STRING = conda list -e -n test_env geokit | Out-String + echo The glaes string is $GLAES_STRING $GLAES_VERSION = [regex]::Match($GLAES_STRING, 'glaes=(\d+\.\d+\.\d+)=').Groups[1].Value echo "GLAES_VERSION=$GLAES_VERSION" >> $GITHUB_OUTPUT - + echo Glaes Version: $GLAES_VERSION + $RESKIT_STRING = conda list -e -n test_env reskit | Out-String + echo The reskit string is $RESKIT_STRING $RESKIT_VERSION = [regex]::Match($RESKIT_STRING, 'glaes=(\d+\.\d+\.\d+)=').Groups[1].Value echo "RESKIT_VERSION=$RESKIT_VERSION" >> $GITHUB_OUTPUT + The reskit version is $RESKIT_VERSION - name: Checkout Fine uses: actions/checkout@v4 with: repository: FZJ-IEK3-VSA/FINE path: './fine' - ref: v${{ steps.fine-version.outputs.FINE_VERSION }} + ref: "v${{ steps.fine-version.outputs.FINE_VERSION }}" fetch-depth: 0 - name: Checkout geokit uses: actions/checkout@v4 diff --git a/.github/workflows/test_fine_geokit.yml b/.github/workflows/test_fine_geokit.yml index 154c526..c114577 100644 --- a/.github/workflows/test_fine_geokit.yml +++ b/.github/workflows/test_fine_geokit.yml @@ -1,4 +1,4 @@ -name: Run combined tests for fine, geokit, glaes and reskit +name: Test fine and geokit installation on: workflow_dispatch: inputs: @@ -68,7 +68,7 @@ jobs: with: repository: FZJ-IEK3-VSA/FINE path: './fine' - ref: v${{ steps.fine-version.outputs.FINE_VERSION }} + ref: "v${{ steps.fine-version.outputs.FINE_VERSION }}" fetch-depth: 0 - name: Checkout geokit uses: actions/checkout@v4 @@ -76,8 +76,7 @@ jobs: repository: FZJ-IEK3-VSA/geokit path: './geokit' ref: ${{ steps.other-version.outputs.GEOKIT_VERSION }} - fetch-depth: 0 - + fetch-depth: 0 - name: Run pytest for fine shell: pwsh diff --git a/.github/workflows/test_fine_geokit_glaes.yml b/.github/workflows/test_fine_geokit_glaes.yml new file mode 100644 index 0000000..047c44f --- /dev/null +++ b/.github/workflows/test_fine_geokit_glaes.yml @@ -0,0 +1,135 @@ +name: Run combined tests for fine, geokit and glaes +on: + workflow_dispatch: + inputs: + tags: + description: 'Manual run' + push: + branches: + - main + pull_request: + branches: + - main + # Allows to trigger the workflow manually + + schedule: + # * is a special character in YAML so you have to quote this string + # Some Examples for cron syntax https://crontab.guru/examples.html + # Schedules job at any point after 12 pm + - cron: '0 0 * * *' + # Weekly after sunday + # - cron: 0 0 * * 0 + +jobs: + TestCombinedInstalaltions: + name: Test on ${{ matrix.os }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + # os: ["ubuntu-latest","ubuntu-20.04", "macos-latest","macos-13","macos-12", "macos-11","windows-latest","windows-2019"] + os: ["ubuntu-latest"] + steps: + - uses: conda-incubator/setup-miniconda@v3 + with: + miniforge-version: latest + channels: conda-forge + activate-environment: test_env + - name: Install libraries + shell: pwsh + id: install-step + run: | + ls + echo "LS Done" + mamba install -v -n test_env fine geokit glaes reskit pytest=6.2.4 scikit-learn=1.1.3 + echo "Installation done" + conda list -n test_env + echo "libaries printed" + - name: Get fine version + shell: pwsh + id: fine-version + run: | + $FINE_STRING = conda list -e -n test_env fine | Out-String + echo the fine string is $FINE_STRING + $FINE_VERSION = [regex]::Match($FINE_STRING, 'fine=(\d+\.\d+\.\d+)=').Groups[1].Value + echo "FINE_VERSION=$FINE_VERSION" >> $GITHUB_OUTPUT + echo fine version: $FINE_VERSION + - name: Get fine version + shell: pwsh + id: other-version + run: | + $GEOKIT_STRING = conda list -e -n test_env geokit | Out-String + echo The geokit string is $GEOKIT_STRING + $GEOKIT_VERSION = [regex]::Match($GEOKIT_STRING, 'geokit=(\d+\.\d+\.\d+)=').Groups[1].Value + echo "GEOKIT_VERSION=$GEOKIT_VERSION" >> $GITHUB_OUTPUT + echo Geokit version: $GEOKIT_VERSION + + $GLAES_STRING = conda list -e -n test_env geokit | Out-String + echo The glaes string is $GLAES_STRING + $GLAES_VERSION = [regex]::Match($GLAES_STRING, 'glaes=(\d+\.\d+\.\d+)=').Groups[1].Value + echo "GLAES_VERSION=$GLAES_VERSION" >> $GITHUB_OUTPUT + echo Glaes Version: $GLAES_VERSION + + + - name: Checkout Fine + uses: actions/checkout@v4 + with: + repository: FZJ-IEK3-VSA/FINE + path: './fine' + ref: "v${{ steps.fine-version.outputs.FINE_VERSION }}" + fetch-depth: 0 + - name: Checkout geokit + uses: actions/checkout@v4 + with: + repository: FZJ-IEK3-VSA/geokit + path: './geokit' + ref: ${{ steps.other-version.outputs.GEOKIT_VERSION }} + fetch-depth: 0 + - name: Checkout glaes + uses: actions/checkout@v4 + with: + repository: FZJ-IEK3-VSA/glaes + path: './glaes' + ref: ${{ steps.other-version.outputs.GLAES_VERSION }} + fetch-depth: 0 + - name: Checkout Reskit + uses: actions/checkout@v4 + with: + repository: FZJ-IEK3-VSA/RESKit + path: './reskit' + ref: ${{ steps.other-version.outputs.RESKIT_VERSION }} + fetch-depth: 0 + + - name: Run pytest for fine + shell: pwsh + run: | + echo "Start ls" + ls + echo "ls terminated" + cd fine + echo "start pytest" + conda run -n test_env python -m pytest test/ + echo "Pytest done" + - name: Run pytest for geokit + shell: pwsh + run: | + echo "Start ls" + ls + echo "ls terminated" + cd geokit + echo "start pytest" + conda run -n test_env python -m pytest + echo "Pytest done" + + - name: Run pytest for glaes + shell: pwsh + run: | + echo "Start ls" + ls + echo "ls terminated" + cd glaes + echo "start pytest" + conda run -n test_env python -m pytest + echo "Pytest done" + + diff --git a/.github/workflows/test_geokit_comp.yml b/.github/workflows/test_geokit_comp.yml index 04abff8..54a4371 100644 --- a/.github/workflows/test_geokit_comp.yml +++ b/.github/workflows/test_geokit_comp.yml @@ -1,4 +1,4 @@ -name: Run combined tests for fine, geokit, glaes and reskit +name: Test Geokit installation with fine constraints on: workflow_dispatch: inputs: @@ -41,7 +41,7 @@ jobs: run: | ls echo "LS Done" - mamba install -v -n test_env geokit pytest=6.2.4 scikit-learn=1.1.3 + mamba install -v -n test_env geokit=1.30 pytest=6.2.4 scikit-learn=1.1.3 echo "Installation done" conda list -n test_env echo "libaries printed"