Skip to content

Commit 42e5160

Browse files
authored
ci: Add job for Mamba installation (#1251)
* ci: Add job for Mamba installation * ci: Import CLIMADA in bash and powershell * ci: Run impact test when testing the installation
1 parent bb95959 commit 42e5160

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/test-install.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Check if installation with conda/mamba works
2+
3+
name: Install Test
4+
5+
on:
6+
schedule:
7+
- cron: "0 6 * * *"
8+
workflow_dispatch:
9+
10+
jobs:
11+
install-conda:
12+
name: Install from Conda
13+
timeout-minutes: 10
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
python-version: ["3.10", "3.11", "3.12"]
19+
os: [ubuntu-latest, windows-latest, macos-latest]
20+
21+
runs-on: ${{ matrix.os }}
22+
23+
steps:
24+
-
25+
name: Install with Mamba
26+
uses: mamba-org/setup-micromamba@v2
27+
with:
28+
environment-name: climada_env_${{ matrix.python-version }}
29+
create-args: >-
30+
python=${{ matrix.python-version }}
31+
climada
32+
init-shell: bash powershell
33+
# Recompute environment for each run, but possibly use cached downloads
34+
cache-environment: false
35+
cache-downloads: true
36+
cache-downloads-key: downloads-${{ matrix.os }}-py${{ matrix.python-version }}
37+
-
38+
name: Test CLIMADA (bash)
39+
shell: bash -el {0}
40+
run: |
41+
python -c "import climada"
42+
python -m unittest climada.engine.test.test_impact
43+
-
44+
name: Test CLIMADA (powershell)
45+
shell: pwsh
46+
if: ${{ matrix.os == 'windows-latest' }}
47+
run: |
48+
python -c "import climada"
49+
python -m unittest climada.engine.test.test_impact

0 commit comments

Comments
 (0)