diff --git a/.github/workflows/axe.yml b/.github/workflows/axe.yml index c5497e0e..6612c7b5 100644 --- a/.github/workflows/axe.yml +++ b/.github/workflows/axe.yml @@ -43,6 +43,26 @@ jobs: - run: pnpm run build --if-present - run: pnpm run preview & npx wait-on http://localhost:4321 - run: pnpm install -g @axe-core/cli + - name: Get Chromium version + run: | + CHROMIUM_VERSION=$(wget -qO- https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_STABLE | cut -d. -f1) + echo "Chromium version: $CHROMIUM_VERSION" + echo "CHROMIUM_VERSION=$CHROMIUM_VERSION" >> $GITHUB_ENV + - name: Setup Chrome + id: setup-chrome + uses: browser-actions/setup-chrome@v1 + with: + chrome-version: ${{ env.CHROMIUM_VERSION }} + - name: Linking Chrome + run: | + rm -f /opt/google/chrome/chrome + ln -s ${{ steps.setup-chrome.outputs.chrome-path }} /opt/google/chrome/chrome + - name: Install chromedriver + run: | + echo "Installing chromedriver version: $CHROMIUM_VERSION" + pnpm install -g chromedriver@$CHROMIUM_VERSION + echo "chromedriver version: $(chromedriver --version)" - name: Run axe run: | - axe http://localhost:4321 --exit \ No newline at end of file + CHROMIUM_VERSION=$(google-chrome --version | cut -d' ' -f3 | cut -d'.' -f1) + axe --chromedriver-path $(pnpm root -g)/chromedriver/bin/chromedriver http://localhost:4321 --exit diff --git a/.github/workflows/lighthouse.yml b/.github/workflows/lighthouse.yml index b7438d7f..df8570e3 100644 --- a/.github/workflows/lighthouse.yml +++ b/.github/workflows/lighthouse.yml @@ -55,6 +55,7 @@ jobs: uploadArtifacts: true temporaryPublicStorage: true runs: 5 + budgetPath: ./.github/workflows/lighthouse/budget.json - name: Format Lighthouse score uses: actions/github-script@v5 id: format_lighthouse_score diff --git a/.github/workflows/lighthouse/budget.json b/.github/workflows/lighthouse/budget.json new file mode 100644 index 00000000..80312d1d --- /dev/null +++ b/.github/workflows/lighthouse/budget.json @@ -0,0 +1,20 @@ +[ + { + "path": "/*", + "resourceSizes": [], + "timings": [ + { + "metric": "largest-contentful-paint", + "budget": 2500 + }, + { + "metric": "max-potential-fid", + "budget": 100 + }, + { + "metric": "cumulative-layout-shift", + "budget": 0.1 + } + ] + } + ] \ No newline at end of file