Skip to content

Commit

Permalink
Make GitHub CI execute unit tests in Petals via reusable workflow (CL…
Browse files Browse the repository at this point in the history
…IMADA-project#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 8037e6f.

* 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 <schmide@ethz.ch>
  • Loading branch information
2 people authored and gdeskos committed Jun 30, 2024
1 parent c0e6526 commit 39dd98b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
-
Expand All @@ -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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 39dd98b

Please sign in to comment.