Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eco ci energy estimation to github action #2

Merged
merged 7 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading