Skip to content

Measure energy consumption of executing integration tests #174

Measure energy consumption of executing integration tests

Measure energy consumption of executing integration tests #174

# This workflow will build a Java project with Ant
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-ant
name: Build project
on:
push:
branches:
- feature/*
- issue/*
- main
pull_request:
branches: [ main ]
schedule:
- cron: "0 0 * * *" # end of the day
jobs:
execute-unitand-integration-tests:
runs-on: ubuntu-latest
steps:
- name: Initialize Energy Estimation
uses: green-coding-solutions/eco-ci-energy-estimation@v2 # use hash or @vX here (See note below)
with:
task: start-measurement
- uses: actions/checkout@v2
- name: Checkout Repo Measurement
uses: green-coding-solutions/eco-ci-energy-estimation@v2 # use hash or @vX here (See note below)
with:
task: get-measurement
label: 'repo checkout'
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
- name: Setup Java Measurement
uses: green-coding-solutions/eco-ci-energy-estimation@v2 # use hash or @vX here (See note below)
with:
task: get-measurement
label: 'java setup'
- name: Run unit tests
run: ./gradlew test
- name: Tests measurement
uses: green-coding-solutions/eco-ci-energy-estimation@v2 # use hash or @vX here (See note below)
with:
task: get-measurement
label: 'unit tests'
- name: Run integration tests
run: ./gradlew integrationTest
- name: Tests measurement
uses: green-coding-solutions/eco-ci-energy-estimation@v2 # use hash or @vX here (See note below)
with:
task: get-measurement
label: 'integration tests'
- name: Show Energy Results
uses: green-coding-solutions/eco-ci-energy-estimation@v2 # use hash or @vX here (See note below)
with:
task: display-results