From 7b1dcda52776df6988973c10ed1b2614caccbfd2 Mon Sep 17 00:00:00 2001 From: Arne Tarara Date: Sat, 18 May 2024 12:43:33 +0200 Subject: [PATCH 1/3] Eco-CI first integration --- .github/workflows/run-tests.yml | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 591dc586..370f75c8 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -34,16 +34,43 @@ jobs: python-version: [3.11] steps: + - name: Eco CI Energy Estimation - Initialize + uses: green-coding-solutions/eco-ci-energy-estimation@main + with: + task: start-measurement + company-uuid: "7f1d34f0-7666-4378-8d8f-d37cced7ccb0" + project-uuid: "a9946d61-149b-4757-99e5-aaac24acf289" + continue-on-error: true + - uses: actions/checkout@v4 + - name: Eco CI Energy Estimation - Get Measurement + uses: green-coding-solutions/eco-ci-energy-estimation@main + with: + task: get-measurement + label: 'checkout' + continue-on-error: true - name: Use Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + - name: Eco CI Energy Estimation - Get Measurement + uses: green-coding-solutions/eco-ci-energy-estimation@main + with: + task: get-measurement + label: 'setup-python' + continue-on-error: true + - name: Install tooling for managing dependencies run: | python -m pip install --upgrade uv wheel + - name: Eco CI Energy Estimation - Get Measurement + uses: green-coding-solutions/eco-ci-energy-estimation@main + with: + task: get-measurement + label: 'pip install uv wheel' + continue-on-error: true # - name: Set up a cache-key for installations of dependencies, in .venv # id: cache-venv @@ -59,6 +86,12 @@ jobs: run: | uv venv uv pip install -r requirements/requirements.linux.generated.txt + - name: Eco CI Energy Estimation - Get Measurement + uses: green-coding-solutions/eco-ci-energy-estimation@main + with: + task: get-measurement + label: 'pip install requirements' + continue-on-error: true - name: Run tests run: | @@ -80,3 +113,17 @@ jobs: EQUINIX_REMOTE_API_ENDPOINT: ${{ secrets.EQUINIX_REMOTE_API_ENDPOINT }} AWS_SHARED_CREDENTIALS_FILE: ${{ secrets.AWS_SHARED_CREDENTIALS_FILE }} AWS_CONFIG_FILE: ${{ secrets.AWS_CONFIG_FILE }} + - name: Eco CI Energy Estimation - Get Measurement + uses: green-coding-solutions/eco-ci-energy-estimation@main + with: + task: get-measurement + label: 'pytest' + continue-on-error: true + + - name: Eco CI Energy Estimation - End Measurement + uses: green-coding-solutions/eco-ci-energy-estimation@main + with: + task: display-results + pr-comment: true + send-data: true + continue-on-error: true From 616274b74f7a761ef1539177d8be0e957e238e97 Mon Sep 17 00:00:00 2001 From: Arne Tarara Date: Sat, 18 May 2024 12:44:11 +0200 Subject: [PATCH 2/3] Added Mardown and .gitignore exclusion --- .github/workflows/run-tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 370f75c8..83796a3b 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -1,6 +1,10 @@ name: Run tests -on: [push] +on: + push: + paths-ignore: + - '**.md' + - '.gitignore' defaults: run: From 10bf0a32bc378cbc1988a8299a87a6abc959c11f Mon Sep 17 00:00:00 2001 From: Arne Tarara Date: Sat, 18 May 2024 13:13:33 +0200 Subject: [PATCH 3/3] PR write permission --- .github/workflows/run-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 83796a3b..ee1c5125 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,6 +13,8 @@ defaults: jobs: run_tests: runs-on: ubuntu-latest + permissions: + pull-requests: write # this allows to show table and charts in PRs services: mariadb: