Skip to content

Commit

Permalink
Merge pull request #2 from ceddlyburge/eco-ci-energy-estimation
Browse files Browse the repository at this point in the history
Add eco ci energy estimation to github action
  • Loading branch information
ceddlyburge authored Oct 9, 2024
2 parents 526fc6e + 0f7d64a commit cde2020
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
56 changes: 55 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,32 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Initialize energy estimation
uses: green-coding-berlin/eco-ci-energy-estimation@v3
with:
task: start-measurement
continue-on-error: true

- uses: actions/checkout@v3

- name: Checkout repo measurement
uses: green-coding-berlin/eco-ci-energy-estimation@v3
with:
task: get-measurement
label: "Repo checkout"
continue-on-error: true

- uses: actions/setup-node@v3
with:
# Choose your Node.js version here:
node-version: 14.x

- name: Setup node measurement
uses: green-coding-berlin/eco-ci-energy-estimation@v3
with:
task: get-measurement
label: "Setup node"
continue-on-error: true

# Re-use node_modules between runs until package.json or package-lock.json changes.
- name: Cache node_modules
id: cache-node_modules
Expand All @@ -26,6 +45,13 @@ jobs:
path: node_modules
key: node_modules-${{ hashFiles('package.json', 'package-lock.json') }}

- name: Cache node modules measurement
uses: green-coding-berlin/eco-ci-energy-estimation@v3
with:
task: get-measurement
label: "Cache node modules"
continue-on-error: true

# Re-use ~/.elm between runs until elm.json, elm-tooling.json or
# review/elm.json changes. The Elm compiler saves downloaded Elm packages
# to ~/.elm.
Expand All @@ -35,8 +61,36 @@ jobs:
path: ~/.elm
key: elm-${{ hashFiles('elm.json', 'review/elm.json') }}

- name: Cache .elm measurement
uses: green-coding-berlin/eco-ci-energy-estimation@v3
with:
task: get-measurement
label: "Cache .elm"
continue-on-error: true

- name: npm i
run: npm i

- name: npm i measurement
uses: green-coding-berlin/eco-ci-energy-estimation@v3
with:
task: get-measurement
label: "npm i"
continue-on-error: true

- name: build
run: npm run check-and-build

- name: build measurement
uses: green-coding-berlin/eco-ci-energy-estimation@v3
with:
task: get-measurement
label: "build"
continue-on-error: true

- name: Show Energy Results
uses: green-coding-berlin/eco-ci-energy-estimation@v3
with:
task: display-results
pr-comment: true
continue-on-error: true
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Tournament organiser

<a href="https://metrics.green-coding.io/ci.html?repo=ceddlyburge/tournament-organiser&amp;branch=2/merge&amp;workflow=51433914"><img src="https://api.green-coding.io/v1/ci/badge/get?repo=ceddlyburge/tournament-organiser&amp;branch=2/merge&amp;workflow=51433914"></a>

Tournament organiser is a website that makes it easy to schedule games in a tournament.

https://tournament-organiser.onrender.com/
Expand Down

0 comments on commit cde2020

Please sign in to comment.