From 164f3dceaa01724f861d7b219c5f9f16a50e4f74 Mon Sep 17 00:00:00 2001 From: Arne Tarara Date: Wed, 19 Jun 2024 14:44:50 +0200 Subject: [PATCH] Added Eco-CI Signed-off-by: Arne Tarara --- .github/workflows/assemble.yml | 47 +++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/.github/workflows/assemble.yml b/.github/workflows/assemble.yml index 51ae075ffa2c9..a5c9a15aa80e8 100644 --- a/.github/workflows/assemble.yml +++ b/.github/workflows/assemble.yml @@ -1,5 +1,6 @@ name: Gradle Assemble -on: [pull_request] +on: + pull_request: jobs: assemble: @@ -10,12 +11,38 @@ jobs: java: [ 11, 17, 21 ] os: [ubuntu-latest, windows-latest, macos-13] steps: + - name: Eco CI Energy Estimation - Initialize + if: matrix.os == 'ubuntu-latest' + uses: green-coding-solutions/eco-ci-energy-estimation@v4.0-rc3 + with: + task: start-measurement + continue-on-error: true + - uses: actions/checkout@v4 + + - name: Eco CI Energy Estimation - Get Measurement + if: matrix.os == 'ubuntu-latest' + uses: green-coding-solutions/eco-ci-energy-estimation@v4.0-rc3 + with: + task: get-measurement + label: 'checkout' + continue-on-error: true + + - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} distribution: temurin + + - name: Eco CI Energy Estimation - Get Measurement + if: matrix.os == 'ubuntu-latest' + uses: green-coding-solutions/eco-ci-energy-estimation@v4.0-rc3 + with: + task: get-measurement + label: 'set up JDK' + continue-on-error: true + - name: Setup docker (missing on MacOS) id: setup_docker if: runner.os == 'macos' @@ -24,6 +51,7 @@ jobs: with: upgrade-qemu: true colima: v0.6.8 + - name: Run Gradle (assemble) if: runner.os == 'macos' && steps.setup_docker.outcome != 'success' run: | @@ -33,7 +61,24 @@ jobs: if: runner.os != 'macos' run: | ./gradlew assemble --parallel --no-build-cache -PDISABLE_BUILD_CACHE + - name: Run Gradle (assemble) if: runner.os == 'macos' && steps.setup_docker.outcome == 'success' run: | ./gradlew assemble --parallel --no-build-cache -PDISABLE_BUILD_CACHE + + - name: Eco CI Energy Estimation - Get Measurement + if: matrix.os == 'ubuntu-latest' + uses: green-coding-solutions/eco-ci-energy-estimation@v4.0-rc3 + with: + task: get-measurement + label: 'gradlew assemble' + continue-on-error: true + + - name: Eco CI Energy Estimation - End Measurement + if: matrix.os == 'ubuntu-latest' + uses: green-coding-solutions/eco-ci-energy-estimation@v4.0-rc3 + with: + task: display-results + send-data: true + continue-on-error: true