From cebb877ec1d3735805b934eb4ab631d444b46b33 Mon Sep 17 00:00:00 2001 From: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:34:46 +0100 Subject: [PATCH 01/11] State storage directories for coverage reports --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) From dfe01d71d528229b63741452ecff23be5bffcf49 Mon Sep 17 00:00:00 2001 From: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:35:20 +0100 Subject: [PATCH 02/11] Call Petals workflow from Core --- .github/workflows/ci.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec18680130..65ca0ff8c0 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: Build Env, Install, Unit Tests' 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 }} - @@ -68,3 +66,12 @@ jobs: with: name: coverage-report-unittests-py${{ matrix.python-version }} path: coverage/ + + test-petals: + name: Petals + uses: CLIMADA-project/climada_petals/.github/workflows/testing.yml@github-actions + with: + core_branch: ${{ github.ref }} + petals_branch: develop + permissions: + checks: write From d1464fcd2e8324ffc356d09773e18f0051a97da6 Mon Sep 17 00:00:00 2001 From: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> Date: Wed, 21 Feb 2024 17:36:49 +0100 Subject: [PATCH 03/11] ci: Fix indentation --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65ca0ff8c0..bfb978cf87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,8 +70,8 @@ jobs: test-petals: name: Petals uses: CLIMADA-project/climada_petals/.github/workflows/testing.yml@github-actions - with: - core_branch: ${{ github.ref }} - petals_branch: develop - permissions: - checks: write + with: + core_branch: ${{ github.ref }} + petals_branch: develop + permissions: + checks: write From cfe6256c84b9627dbe82a0c57ee103b8eaefaa79 Mon Sep 17 00:00:00 2001 From: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> Date: Thu, 22 Feb 2024 10:18:23 +0100 Subject: [PATCH 04/11] ci: Only execute Petals tests if core succeeds --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bfb978cf87..fe8aa7bf51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,8 +70,9 @@ jobs: test-petals: name: Petals uses: CLIMADA-project/climada_petals/.github/workflows/testing.yml@github-actions + needs: build-and-test with: core_branch: ${{ github.ref }} - petals_branch: develop + petals_branch: github-actions permissions: checks: write From 8037e6facb0e0ec19072d5790a0d29998db77ffe Mon Sep 17 00:00:00 2001 From: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> Date: Fri, 23 Feb 2024 10:37:15 +0100 Subject: [PATCH 05/11] ci: Use specific SHA for petals pipeline --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe8aa7bf51..56f682e171 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,10 +69,10 @@ jobs: test-petals: name: Petals - uses: CLIMADA-project/climada_petals/.github/workflows/testing.yml@github-actions + uses: CLIMADA-project/climada_petals/.github/workflows/testing.yml@39e0e94b9b30e3797cd07d615984af8ad6ad4c09 needs: build-and-test with: core_branch: ${{ github.ref }} - petals_branch: github-actions + petals_branch: 39e0e94b9b30e3797cd07d615984af8ad6ad4c09 permissions: checks: write From 15b2ce6a34b4f93661395d969e8f42e2c5a10267 Mon Sep 17 00:00:00 2001 From: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> Date: Fri, 23 Feb 2024 15:07:52 +0100 Subject: [PATCH 06/11] Revert "ci: Use specific SHA for petals pipeline" This reverts commit 8037e6facb0e0ec19072d5790a0d29998db77ffe. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56f682e171..fe8aa7bf51 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,10 +69,10 @@ jobs: test-petals: name: Petals - uses: CLIMADA-project/climada_petals/.github/workflows/testing.yml@39e0e94b9b30e3797cd07d615984af8ad6ad4c09 + uses: CLIMADA-project/climada_petals/.github/workflows/testing.yml@github-actions needs: build-and-test with: core_branch: ${{ github.ref }} - petals_branch: 39e0e94b9b30e3797cd07d615984af8ad6ad4c09 + petals_branch: github-actions permissions: checks: write From c2195da61b89a19f78063edc0f9432778ee07653 Mon Sep 17 00:00:00 2001 From: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:18:23 +0200 Subject: [PATCH 07/11] Rename checks and results Add TODO for updating branch ref after the corresponding Petals PR is merged. --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe8aa7bf51..462e05c76e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ defaults: jobs: build-and-test: - name: 'Core: Build Env, Install, Unit Tests' + name: 'Core / Unit Tests' runs-on: ubuntu-latest permissions: # For publishing results @@ -57,22 +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 + name: Petals Compatibility uses: CLIMADA-project/climada_petals/.github/workflows/testing.yml@github-actions needs: build-and-test with: core_branch: ${{ github.ref }} - petals_branch: github-actions + petals_branch: github-actions # TODO: Change this to 'develop' once Petals PR is merged! permissions: checks: write From e036af13864ae3fa30b9079125d36768981cf5a4 Mon Sep 17 00:00:00 2001 From: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:32:23 +0200 Subject: [PATCH 08/11] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d08b14155..c0fbbabf7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ Code freeze date: YYYY-MM-DD ### Added +- GitHub actions workflow for unit tests [#114](https://github.com/CLIMADA-project/climada_petals/pull/114) + ### Changed ### Fixed From 634157d1d7baf7e1644a05395ad6e226b17747fb Mon Sep 17 00:00:00 2001 From: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> Date: Wed, 10 Apr 2024 11:41:11 +0200 Subject: [PATCH 09/11] Switch to Petals develop branch version of reusable workflow --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 462e05c76e..62f4c15205 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,6 +73,6 @@ jobs: needs: build-and-test with: core_branch: ${{ github.ref }} - petals_branch: github-actions # TODO: Change this to 'develop' once Petals PR is merged! + petals_branch: develop permissions: checks: write From da1a90341f005127a159ccaa8dfd235fd9ec947d Mon Sep 17 00:00:00 2001 From: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> Date: Fri, 3 May 2024 11:58:56 +0200 Subject: [PATCH 10/11] Rename 'Unit Tests' job to 'Unit Test Pipeline' ... to better distringuish from the test result. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62f4c15205..fd373797ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ defaults: jobs: build-and-test: - name: 'Core / Unit Tests' + name: 'Core / Unit Test Pipeline' runs-on: ubuntu-latest permissions: # For publishing results From c37ec6070b83f3e85af756c57663d92b5739eebd Mon Sep 17 00:00:00 2001 From: Lukas Riedel <34276446+peanutfun@users.noreply.github.com> Date: Fri, 3 May 2024 14:43:27 +0200 Subject: [PATCH 11/11] Switch branch for accessing Petals workflow --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd373797ba..55c055b939 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,7 @@ jobs: test-petals: name: Petals Compatibility - uses: CLIMADA-project/climada_petals/.github/workflows/testing.yml@github-actions + uses: CLIMADA-project/climada_petals/.github/workflows/testing.yml@develop needs: build-and-test with: core_branch: ${{ github.ref }}