From 39dd98ba12dc384b9937a7b12b41723602d45200 Mon Sep 17 00:00:00 2001 From: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> Date: Wed, 15 May 2024 09:50:52 +0200 Subject: [PATCH] Make GitHub CI execute unit tests in Petals via reusable workflow (#855) * State storage directories for coverage reports * Call Petals workflow from Core * ci: Fix indentation * ci: Only execute Petals tests if core succeeds * ci: Use specific SHA for petals pipeline * Revert "ci: Use specific SHA for petals pipeline" This reverts commit 8037e6facb0e0ec19072d5790a0d29998db77ffe. * Rename checks and results Add TODO for updating branch ref after the corresponding Petals PR is merged. * Update CHANGELOG.md * Switch to Petals develop branch version of reusable workflow * Rename 'Unit Tests' job to 'Unit Test Pipeline' ... to better distringuish from the test result. * Switch branch for accessing Petals workflow --------- Co-authored-by: emanuel-schmid --- .github/workflows/ci.yml | 20 ++++++++++++++------ CHANGELOG.md | 4 ++++ Makefile | 4 ++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec18680130..55c055b939 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,11 +6,11 @@ on: [push] # Use bash explicitly for being able to enter the conda environment defaults: run: - shell: bash -l {0} + shell: bash -el {0} jobs: build-and-test: - name: Build Env, Install, Unit Tests + name: 'Core / Unit Test Pipeline' runs-on: ubuntu-latest permissions: # For publishing results @@ -41,8 +41,6 @@ jobs: create-args: >- python=${{ matrix.python-version }} make - init-shell: >- - bash # Persist environment for branch, Python version, single day cache-environment-key: env-${{ github.ref }}-${{ matrix.python-version }}-${{ steps.date.outputs.date }} - @@ -59,12 +57,22 @@ jobs: if: always() with: junit_files: tests_xml/tests.xml - check_name: "Unit Test Results Python ${{ matrix.python-version }}" + 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-unittests-py${{ matrix.python-version }} + 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index fa70f5a330..5f95984833 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ Code freeze date: YYYY-MM-DD ### Dependency Changes +### Added + +- GitHub actions workflow for CLIMADA Petals compatibility tests [#855](https://github.com/CLIMADA-project/climada_python/pull/855) + ### Changed - Remove content tables and make minor improvements (fix typos and readability) in diff --git a/Makefile b/Makefile index 57c5a7035f..046d9501bc 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,8 @@ PYTEST_JUNIT_ARGS = --junitxml=tests_xml/tests.xml PYTEST_COV_ARGS = \ - --cov --cov-config=.coveragerc --cov-report html --cov-report xml \ - --cov-report term:skip-covered + --cov --cov-config=.coveragerc --cov-report html:coverage \ + --cov-report xml:coverage.xml --cov-report term:skip-covered PYTEST_ARGS = $(PYTEST_JUNIT_ARGS) $(PYTEST_COV_ARGS)