From 86a56bb73f828076102765abf8ca7942ea5df37a Mon Sep 17 00:00:00 2001 From: khagen <33468547+koenhagen@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:15:32 +0100 Subject: [PATCH] New workflow for energy measurement --- .github/workflows/main.yml | 78 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..1b5feac4 --- /dev/null +++ b/.github/workflows/main.yml @@ -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