-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (46 loc) · 1.29 KB
/
tests.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
name: Makes valid measurements
on:
push:
branches:
- main
pull_request:
jobs:
checkup:
name: Inspect the code health
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21.x'
- name: Install dependencies
run: go get
- name: Build binary
run: go build
- name: Check formatting
run: test -z $(gofmt -l $(find . -name '*.go'))
- name: Run tests
run: go test ./...
measurement:
name: Monitor energy usage
needs: checkup
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Clean the environment
run: make clean
- name: Prepare the program
run: make build
- name: Sleep for a short while
run: ./etime sleep 4
env:
EMPORIA_DEVICE: ${{ secrets.EMPORIA_DEVICE }}
EMPORIA_USERNAME: ${{ secrets.EMPORIA_USERNAME }}
EMPORIA_PASSWORD: ${{ secrets.EMPORIA_PASSWORD }}
- name: Sleep for a bit longer
run: ./etime sleep 12
env:
EMPORIA_DEVICE: ${{ secrets.EMPORIA_DEVICE }}
EMPORIA_USERNAME: ${{ secrets.EMPORIA_USERNAME }}
EMPORIA_PASSWORD: ${{ secrets.EMPORIA_PASSWORD }}