-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (81 loc) · 2.63 KB
/
build-test.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: Build and test
on:
push:
branches:
- "main"
pull_request:
jobs:
main:
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
uses: actions/cache@v3
with:
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.
# - name: Cache ~/.elm
# uses: actions/cache@v3
# with:
# 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