-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (73 loc) · 2.7 KB
/
examples-application-testing-vm.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
name: Examples Directory Tests Run - VM
run-name: Examples Directory Test Run - ${{ github.ref_name }}
on:
schedule:
- cron: '0 0 * * *'
branches: [ "main" ]
#push:
# branches: [ "workflow-tweaks" ]
workflow_dispatch:
jobs:
check-commits:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
name: Check latest commit
outputs:
recent_gmt_commit: ${{ steps.check_gmt_commits.outputs.should_run }}
recent_examples_commit: ${{ steps.check_examples_commits.outputs.should_run }}
steps:
- id: check_gmt_commits
uses: green-coding-berlin/green-ci-activity-checker@main
with:
repo: 'green-coding-berlin/green-metrics-tool'
branch: 'main'
- id: check_examples_commits
uses: green-coding-berlin/green-ci-activity-checker@main
with:
repo: 'green-coding-berlin/example-applications'
branch: 'main'
workflow-id: 45266619
run-tests:
needs: check-commits
if: ${{ needs.check-commits.outputs.recent_examples_commit == 'true' || needs.check-commits.outputs.recent_gmt_commit == 'true' || github.event_name == 'workflow_dispatch'}}
#runs-on: self-hosted
runs-on: ubuntu-latest
steps:
- name: Initialize Energy Estimation
uses: green-coding-berlin/eco-ci-energy-estimation@main
with:
task: start-measurement
- name: Checkout Examples Directory
uses: actions/checkout@v3
with:
path: examples-directory
- name: Checkout Green Metrics Tool
uses: actions/checkout@v3
with:
repository: green-coding-berlin/green-metrics-tool
submodules: 'true'
path: green-metrics-tool
ref: main
- name: Energy Estimation - Get Measurement
uses: green-coding-berlin/eco-ci-energy-estimation@main
with:
task: get-measurement
label: setup
- name: 'Setup, Run, and Teardown Tests'
uses: green-coding-berlin/green-metrics-tool/.github/actions/gmt-pytest@main
with:
metrics-to-turn-off: '--categories RAPL Machine Sensors Debug CGroupV2 MacOS GPU'
gmt-directory: './green-metrics-tool'
tests-command: 'pytest ../../examples-directory/test/smoke_test.py -k "test_all_directories"'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Energy Estimation - Get Measurement
uses: green-coding-berlin/eco-ci-energy-estimation@main
with:
task: get-measurement
label: tests
- name: Energy Estimation - End Measurement
uses: green-coding-berlin/eco-ci-energy-estimation@main
with:
task: display-results