forked from vszakats/eco-ci-energy-estimation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml.example
37 lines (26 loc) · 1.06 KB
/
.gitlab-ci.yml.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
image: ubuntu:22.04
include:
remote: 'https://raw.githubusercontent.com/green-coding-solutions/eco-ci-energy-estimation/main/eco-ci-gitlab.yml'
# trigger rebuild
stages:
- test
before_script:
- apt-get update
- apt-get install git jq curl -y # git, jq and curl are dependencies for Eco-CI
test-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
script:
- !reference [.start_measurement, script]
- sleep 2 # Placeholder for your main pipeline logic
- export ECO_CI_LABEL="Sleep 2" # Set a custom name for a step
- !reference [.get_measurement, script] # take a measurement
- sleep 10s # Placeholder for more main pipeline logic here
- export ECO_CI_LABEL="Sleep 10"
- !reference [.get_measurement, script] # Take another measurement
- !reference [.display_results, script] # Show the results
artifacts:
paths:
- eco-ci-output.txt
- eco-ci-total-data.json # only if you have JSON output active
reports:
metrics: metrics.txt