Skip to content

fix(deps): update dependency astro to v4.11.3 #111

fix(deps): update dependency astro to v4.11.3

fix(deps): update dependency astro to v4.11.3 #111

Workflow file for this run

name: E2E Test
on:
pull_request:
workflow_call:
workflow_dispatch:
schedule:
- cron: '0 0 * * SUN'
permissions: {}
defaults:
run:
shell: bash
jobs:
test-e2e-general:
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read # for checkout
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install mise
uses: jdx/mise-action@d6e32c1796099e0f1f3ac741c220a8b7eae9e5dd # v2.0.6
with:
experimental: true
- name: Install package.json dependencies
run: mise run buni
- name: Build Package
run: mise run build
- name: Install E2E Test Fixtures Dependencies
run: bun install --frozen-lockfile
working-directory: tests/e2e/fixtures
- name: Build E2E Test Fixtures with astro-better-image-service
run: bun run build
working-directory: tests/e2e/fixtures
- name: Store Dependency Versions
id: dependency-versions
run: |
playwright_version=$(bun pm ls | sed -nE 's/.*@playwright\/test@(.+)/\1/p')
echo "playwright=$playwright_version" >> "$GITHUB_OUTPUT"
- name: Restore Playwright Browsers Cache
id: restore-browsers-cache
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ runner.os }}-${{ steps.dependency-versions.outputs.playwright }}
- name: Install Playwright Browsers and Dependencies
id: playwright-install
if: steps.restore-browsers-cache.outputs.cache-hit != 'true'
run: bun run playwright install chromium --with-deps
- name: Save Playwright Browsers Cache
if: steps.restore-browsers-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.cache/ms-playwright
key: ${{ steps.restore-browsers-cache.outputs.cache-primary-key }}
- name: Install Playwright Dependencies
if: steps.playwright-install.outcome == 'skipped'
run: bun run playwright install-deps chromium
- name: Playwright Test
id: playwright-test
run: mise run test:e2e
- name: Upload the Playwright Report
# use failure() because success() is used implicitly
# ref: https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions
if: failure() && steps.playwright-test.outcome == 'failure'
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: playwright-report-${{ github.sha }}
path: playwright-report/
test-e2e-conversion:
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read # for checkout
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install mise
uses: jdx/mise-action@d6e32c1796099e0f1f3ac741c220a8b7eae9e5dd # v2.0.6
with:
experimental: true
- name: Install package.json dependencies
run: mise run buni
- name: Build Package
run: mise run build
- name: Store Dependency Versions
id: dependency-versions
run: |
playwright_version=$(bun pm ls | sed -nE 's/.*@playwright\/test@(.+)/\1/p')
astro_version=$(bun pm ls | sed -nE 's/.*astro@(.+)/\1/p')
echo "playwright=$playwright_version" >> "$GITHUB_OUTPUT"
echo "astro=$astro_version" >> "$GITHUB_OUTPUT"
- name: Restore Playwright Browsers Cache
id: restore-browsers-cache
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ runner.os }}-${{ steps.dependency-versions.outputs.playwright }}
- name: Install Playwright Browsers and Dependencies
id: playwright-install
if: steps.restore-browsers-cache.outputs.cache-hit != 'true'
run: bun run playwright install chromium --with-deps
- name: Save Playwright Browsers Cache
if: steps.restore-browsers-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.cache/ms-playwright
key: ${{ steps.restore-browsers-cache.outputs.cache-primary-key }}
- name: Install Playwright Dependencies
if: steps.playwright-install.outcome == 'skipped'
run: bun run playwright install-deps chromium
- name: Store Hash of E2E Test Fixtures and Image Service Consistency Test
id: fixtures-hash
run: echo "hash=${{ hashFiles('tests/e2e/fixtures/**/*', 'tests/e2e/conversion.test.ts') }}" >> "$GITHUB_OUTPUT"
- name: Install E2E Test Fixtures Dependencies
run: bun install --frozen-lockfile
working-directory: tests/e2e/fixtures
- name: Restore Snapshots Cache
id: restore-snapshots-cache
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: tests/e2e/conversion.test.ts-snapshots
key: "default-service-snapshots-${{ runner.os }}-${{ steps.dependency-versions.outputs.astro }}-${{ steps.dependency-versions.outputs.playwright }}-${{ steps.fixtures-hash.outputs.hash }}"
- name: Build E2E Test Fixtures with the Default Image Service
if: steps.restore-snapshots-cache.outputs.cache-hit != 'true'
run: bun run build
working-directory: tests/e2e/fixtures
env:
USE_DEFAULT_IMAGE_SERVICE: true
- name: Take Snapshots with the Default Image Service
if: steps.restore-snapshots-cache.outputs.cache-hit != 'true'
run: bun run playwright test conversion --update-snapshots
env:
USE_DEFAULT_IMAGE_SERVICE: true
- name: Save Snapshots Cache
if: steps.restore-snapshots-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: tests/e2e/conversion.test.ts-snapshots
key: ${{ steps.restore-snapshots-cache.outputs.cache-primary-key }}
- name: Build E2E Test Fixtures with astro-better-image-service
run: bun run build
working-directory: tests/e2e/fixtures
- name: Playwright Image Services Consistency Test
id: playwright-test-conversion
run: bun run playwright test conversion
- name: Upload the Playwright Report of Image Services Consistency Test
# use failure() because success() is used implicitly
# ref: https://docs.github.com/en/actions/learn-github-actions/expressions#status-check-functions
if: failure() && steps.playwright-test-conversion.outcome == 'failure'
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: playwright-report-conversion-${{ github.sha }}
path: playwright-report/
actions-timeline:
needs:
- test-e2e-general
- test-e2e-conversion
# skip if the workflow is called from another workflow
if: ${{ !cancelled() && contains(github.workflow_ref, '/e2e.yml') }}
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions:
actions: read
steps:
- name: actions-timeline
# cspell:ignore kesin
uses: Kesin11/actions-timeline@518da3e0348d81936d2582859c88984728434d78 # v2.1.2