New workflow for energy measurement

This commit is contained in:
khagen 2023-11-06 14:15:32 +01:00 committed by GitHub
parent 4c3c11c958
commit 86a56bb73f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 78 additions and 0 deletions

78
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,78 @@
name: Tests with Energy Measurement
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
actions: read
pull-requests: write
jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Initialize Energy Estimation
uses: green-coding-berlin/eco-ci-energy-estimation@v2 # use hash or @vX here (See note below)
with:
task: start-measurement
send-data: false
- name: 'Checkout repository'
uses: actions/checkout@v3
with:
ref: 'dev'
submodules: 'true'
- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.10'
architecture: x64
cache: 'pip'
cache-dependency-path: 'requirements*'
- name: pip install
shell: bash
run: |
pip install -r requirements.txt
- name: check OS
run: cat /etc/os-release
- name: set ENV
run: export TRAINER_TELEMETRY=0
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends git make gcc
make system-deps
- name: Install/upgrade Python setup deps
run: python3 -m pip install --upgrade pip setuptools wheel
- name: Replace scarf urls
run: |
sed -i 's/https:\/\/coqui.gateway.scarf.sh\//https:\/\/github.com\/coqui-ai\/TTS\/releases\/download\//g' TTS/.models.json
- name: Install TTS
run: |
python3 -m pip install .[all]
python3 setup.py egg_info
- name: Tests measurement
uses: green-coding-berlin/eco-ci-energy-estimation@v2 # use hash or @vX here (See note below)
with:
task: get-measurement
label: 'setup'
send-data: false
- name: Unit tests
run: make data_tests
- name: Tests measurement
uses: green-coding-berlin/eco-ci-energy-estimation@v2 # use hash or @vX here (See note below)
with:
task: get-measurement
label: 'unit tests'
send-data: false
- name: Show Energy Results
uses: green-coding-berlin/eco-ci-energy-estimation@v2 # use hash or @vX here (See note below)
with:
task: display-results
send-data: false