Examples Directory Test Run - main #567
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Examples Directory Tests Run - VM | |
run-name: Examples Directory Test Run - ${{ github.ref_name }} | |
on: | |
schedule: | |
- cron: '0 3 * * 3' # every wednesday at 3 AM | |
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 |