forked from green-coding-solutions/green-metrics-tool
-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (56 loc) · 1.96 KB
/
Copy pathtests-vm-pr.yml
File metadata and controls
63 lines (56 loc) · 1.96 KB
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
name: Pull Request Tests
run-name: PR check
on:
pull_request:
types: [opened, synchronize]
workflow_dispatch:
inputs:
enable-ssh:
description: 'Enable SSH connection for debugging purposes'
required: false
type: boolean
test-path:
description: 'Specific test path to run'
required: false
type: string
jobs:
run-tests:
runs-on: ubuntu-24.04
permissions:
pull-requests: write
packages: write
steps:
- name: Eco CI Energy Estimation - Initialize
uses: green-coding-solutions/eco-ci-energy-estimation@main
with:
task: start-measurement
project: "Green Metrics Tool"
machine: "ubuntu-latest"
tags: "CI/CD, PR-Workflow"
gmt-api-token: ${{ secrets.GMT_API_TOKEN }}
# Intensity for California, where many GitHub Servers are in 2024
# we use constant here, as GitHub Actions Bot cannot access the secrets, where we would store the Electricitymaps token
co2-calculation-method: 'constant'
co2-grid-intensity-constant: 231
- name: 'Checkout repository'
uses: actions/checkout@v7
with:
ref: ${{ github.ref }}
submodules: 'false'
- name: 'Setup, Run, and Teardown Tests'
uses: ./.github/actions/gmt-pytest
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
docker-user: ${{ secrets.GMT_TESTING_DOCKER_USER }}
docker-pat: ${{ secrets.GMT_TESTING_DOCKER_PAT }}
enable-ssh: ${{ inputs.enable-ssh }}
test-path: ${{ inputs.test-path }}
- name: Eco CI Energy Estimation - Get Measurement
uses: green-coding-solutions/eco-ci-energy-estimation@main
with:
task: get-measurement
- name: Eco CI Energy Estimation - End Measurement
uses: green-coding-solutions/eco-ci-energy-estimation@main
with:
task: display-results
pr-comment: true