Make conda-env hook not use uv #2439
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: GitHub CI | |
| # Execute this for every push | |
| on: [push] | |
| # Use bash explicitly for being able to enter the conda environment | |
| defaults: | |
| run: | |
| shell: bash -el {0} | |
| env: | |
| CLIMADA_DATA_DOI: 10.5281/zenodo.20595842 | |
| jobs: | |
| integration-test: | |
| name: 'Core / Integration Test Pipeline' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - | |
| name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - | |
| name: Write climada.conf system data | |
| uses: amochkin/action-json@v1 | |
| with: | |
| mode: write | |
| file: climada.conf | |
| property: local_data.system | |
| value: ${{ github.workspace }}/climada/data | |
| - | |
| name: Write climada.conf demo data | |
| uses: amochkin/action-json@v1 | |
| with: | |
| mode: write | |
| file: climada.conf | |
| property: local_data.demo | |
| value: ${{ github.workspace }}/climada/demo | |
| - | |
| run: | | |
| cat climada.conf | |
| - | |
| name: Install make | |
| uses: awalsh128/cache-apt-pkgs-action@v1 | |
| with: | |
| packages: make | |
| - | |
| name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| python-version: "3.12" | |
| cache-suffix: integrationtest | |
| - | |
| name: Install dependencies | |
| run: | | |
| uv sync --locked --dev | |
| - | |
| name: Cache data | |
| uses: actions/cache@v5 | |
| with: | |
| path: ${{ github.workspace }}/climada | |
| key: ${{ env.CLIMADA_DATA_DOI }} | |
| - | |
| name: Download and unzip data | |
| run: | | |
| uvx zenodo_get ${{ env.CLIMADA_DATA_DOI }} | |
| unzip climada.zip -d ${{ github.workspace }} | |
| - | |
| name: Run Integration Tests | |
| run: | | |
| uv run -- python -c "from climada.util.constants import SYSTEM_DIR; print(SYSTEM_DIR)" | |
| make integ_test | |
| continue-on-error: true | |
| build-and-test: | |
| name: 'Core / Unit Test Pipeline' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| permissions: | |
| # For publishing results | |
| checks: write | |
| # Run this test for different Python versions | |
| strategy: | |
| # Do not abort other tests if only a single one fails | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - | |
| name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| - | |
| # Store the current date to use it as cache key for the environment | |
| name: Get current date | |
| id: date | |
| run: echo "date=$(date +%Y-%m-%d)" >> "${GITHUB_OUTPUT}" | |
| - | |
| name: Install make | |
| uses: awalsh128/cache-apt-pkgs-action@v1 | |
| with: | |
| packages: make | |
| - | |
| name: Install uv | |
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache-suffix: unittest | |
| - | |
| name: Install dependencies | |
| run: | | |
| uv sync --locked --dev | |
| - | |
| name: Run Unit Tests | |
| run: | | |
| make unit_test | |
| - | |
| name: Publish Test Results | |
| uses: EnricoMi/publish-unit-test-result-action@v2 | |
| if: always() | |
| with: | |
| junit_files: tests_xml/tests.xml | |
| check_name: "Core / Unit Test Results (${{ matrix.python-version }})" | |
| comment_mode: "off" | |
| - | |
| name: Upload Coverage Reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report-core-unittests-py${{ matrix.python-version }} | |
| path: coverage/ | |
| test-petals: | |
| name: Petals Compatibility | |
| uses: CLIMADA-project/climada_petals/.github/workflows/testing.yml@develop | |
| needs: build-and-test | |
| with: | |
| core_branch: ${{ github.ref }} | |
| petals_branch: develop | |
| permissions: | |
| checks: write |