forked from green-coding-solutions/eco-ci-energy-estimation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml.example
40 lines (33 loc) · 1.22 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
38
39
40
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
test-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
script:
#- export ECO_CI_COMPANY_UUID="YOUR COMPANY UUID"
#- export ECO_CI_PROJECT_UUID="YOUR PROJECT UUID"
#- export ECO_CI_MACHINE_UUID="YOUR MACHINE UUID"
- apt-get update
- apt-get install git jq curl -y # git, jq and curl are a depedency for Eco-CI as we need to clone the gitlab repo
- !reference [.start_measurement, script]
- sleep 2
- export ECO_CI_LABEL="Sleep 2"
- ls -alh /tmp/eco-ci
- echo "Step"
- cat /tmp/eco-ci/cpu-util-step.txt
- !reference [.get_measurement, script]
- echo "Total"
- cat /tmp/eco-ci/cpu-util-total.txt
- echo "Energy"
- cat /tmp/eco-ci/energy-step.txt
- timeout 10s grep -R xxx / 1> /dev/null 2>/dev/null || true
- export ECO_CI_LABEL="grep with timeout"
- !reference [.get_measurement, script]
- !reference [.display_results, script]
artifacts:
paths:
- eco-ci-output.txt
- metrics.txt