From 815fe427871a4d7da473a4eba6ad5d9eb4d6b761 Mon Sep 17 00:00:00 2001 From: ccamel Date: Tue, 7 Nov 2023 11:03:46 +0100 Subject: [PATCH 1/2] ci(workflow): use npm cache whenever possible --- .github/workflows/lint.yml | 1 + .github/workflows/publish.yml | 1 + .github/workflows/update-versioned-docs.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 275a2b265b9..ccd7968d97b 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -151,6 +151,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 16.18 + cache: yarn - name: Fetch dependencies run: | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 04e1f553348..8fff323b18a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,6 +19,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 16.18 + cache: yarn - name: Fetch dependencies run: | diff --git a/.github/workflows/update-versioned-docs.yml b/.github/workflows/update-versioned-docs.yml index 95df3c7bb70..8353ccb12c1 100644 --- a/.github/workflows/update-versioned-docs.yml +++ b/.github/workflows/update-versioned-docs.yml @@ -63,6 +63,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 16.18 + cache: yarn - name: Bump new version if: ${{ github.event.inputs.draft == 'false' }} From 53b1d6c0555aa3263a489ee3d6e71b8b341e2bb8 Mon Sep 17 00:00:00 2001 From: ccamel Date: Tue, 7 Nov 2023 10:56:02 +0100 Subject: [PATCH 2/2] ci(workflow): add lint-web job --- .github/workflows/lint.yml | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ccd7968d97b..a54900a7629 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -94,6 +94,56 @@ jobs: env: FOLDER: ./static + lint-web: + runs-on: ubuntu-22.04 + env: + WEB_PORT: 3000 + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Setup node environment (for building) + uses: actions/setup-node@v4 + with: + node-version: 16.18 + cache: yarn + + - name: Fetch dependencies + run: | + yarn --frozen-lockfile + + - name: Start web server + run: | + yarn build + yarn serve --port $WEB_PORT --no-open & + sleep 2 + + - name: Create artifacts directory + run: | + mkdir -p ${{ github.workspace }}/tmp/artifacts + + - name: Run Lighthouse + uses: foo-software/lighthouse-check-action@v10.0.0 + with: + prCommentEnabled: true + maxRetries: 2 + outputDirectory: ${{ github.workspace }}/tmp/artifacts + device: all + urls: >- + http://localhost:${{ env.WEB_PORT }}/ + gitHubAccessToken: ${{ secrets.OKP4_TOKEN }} + + - name: Upload lighthouse reports + uses: actions/upload-artifact@v3.1.3 + with: + name: Lighthouse reports + path: ${{ github.workspace }}/tmp/artifacts + + - name: Stop web server + if: always() + run: | + kill $(lsof -t -i:$WEB_PORT) + report-new-dependencies: runs-on: ubuntu-22.04 if: github.event_name == 'pull_request' && github.actor != 'dependabot[bot]'