From cfba8835360bd535ef9d82f66a6707f56962f57e Mon Sep 17 00:00:00 2001 From: vscaiceanu-1a <86055112+vscaiceanu-1a@users.noreply.github.com> Date: Thu, 26 Dec 2024 17:33:16 +0100 Subject: [PATCH] ci: eco ci measurements --- .github/workflows/CI.yml | 43 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 206e03c3..a581fd29 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -8,7 +8,20 @@ jobs: test: runs-on: ubuntu-latest steps: + - name: Start Measurement + uses: green-coding-solutions/eco-ci-energy-estimation@v4 + with: + task: start-measurement + continue-on-error: true + - uses: actions/checkout@v4 + - name: Checkout Repo Measurement + uses: green-coding-solutions/eco-ci-energy-estimation@v4 + with: + task: get-measurement + label: 'repo checkout' + continue-on-error: true + - uses: actions/setup-node@v4 with: node-version: '20' @@ -25,12 +38,31 @@ jobs: ${{ runner.os }}- - name: Install run: yarn --immutable + - name: Setup and install Measurment + uses: green-coding-solutions/eco-ci-energy-estimation@v4 + with: + task: get-measurement + label: 'setup-and-install' + continue-on-error: true + - name: Build run: yarn build + - name: Build Measurment + uses: green-coding-solutions/eco-ci-energy-estimation@v4 + with: + task: get-measurement + label: 'build' + continue-on-error: true - name: Unit Tests run: yarn test - name: Lint run: yarn lint + - name: Test and Lint Measurment + uses: green-coding-solutions/eco-ci-energy-estimation@v4 + with: + task: get-measurement + label: 'test-and-lint' + continue-on-error: true - name: Install, build and start demo app run: | cd examples/my-ngsw-app @@ -41,3 +73,14 @@ jobs: cd examples/my-ngsw-app npx playwright install chromium npm run test:e2e + - name: E2E tests Measurment + uses: green-coding-solutions/eco-ci-energy-estimation@v4 + with: + task: get-measurement + label: 'e2e-test' + continue-on-error: true + - name: Show Energy Results + uses: green-coding-solutions/eco-ci-energy-estimation@v4 # use hash or @vX here (See note below) + with: + task: display-results + # continue-on-error: true # recommended setting for production. See notes below. \ No newline at end of file