Skip to content

Docker Sanity Test Checks #3

Docker Sanity Test Checks

Docker Sanity Test Checks #3

name: Docker Sanity Test Checks
on:
workflow_dispatch:
workflow_call:
permissions:
actions: write
checks: write
contents: write
pull-requests: write
packages: write
env:
BRANCH_NAME: ${{ github.event.pull_request.head_ref || github.event.pull_request.head.ref_name || github.head_ref || github.ref_name }}
NODE_VERSION: 20
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
sanity-test-puppeteer:
name: 🤪 Puppeteer
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout actions
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.head_ref || github.ref_name || github.ref }}
sparse-checkout: |
.github/actions
path: actions
- uses: ./actions/.github/actions/setup-base
id: base
- uses: ./actions/.github/actions/prepare-docker
with:
REGISTRY: ${{ env.REGISTRY }}
ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "𓋏 Run `backstop test` in Docker"
continue-on-error: true
shell: bash
working-directory: ${{ steps.base.outputs.WORKSPACE_ROOT }}
run: |
set +e
cd test/configs/ && docker run --rm -t --mount type=bind,source="$(pwd)",target=/src $REGISTRY/$IMAGE_NAME_LC:$TAG test
- name: "Validate Puppeteer Docker Test Results"
uses: ./actions/.github/actions/sanity-test-checks
with:
WORKSPACE_ROOT: ${{ steps.base.outputs.WORKSPACE_ROOT }}
RUNNER: "Puppeteer"
FIXTURE: "sanity-test-docker.json"
sanity-test-playwright:
name: 🤪 Playwright
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout actions
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.head_ref || github.ref_name || github.ref }}
sparse-checkout: |
.github/actions
path: actions
- uses: ./actions/.github/actions/setup-base
id: base
- uses: ./actions/.github/actions/prepare-docker
with:
REGISTRY: ${{ env.REGISTRY }}
ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "🎭 Run `backstop test --confg=playwright` in Docker"
continue-on-error: true
run: |
set +e
cd test/configs/ && docker run --rm -t --entrypoint='' --mount type=bind,source="$(pwd)",target=/src $REGISTRY/$IMAGE_NAME_LC:$TAG sh -c "chmod -R 777 /root && chmod -R 777 /opt/pw-browsers && npm --verbose --foreground-scripts i -D playwright && npx --verbose --foreground-scripts --yes playwright@$PLAYWRIGHT_VERSION install && backstop test --config=playwright"
- name: "Validate Playwright Docker Test Results"
uses: ./actions/.github/actions/sanity-test-checks
with:
WORKSPACE_ROOT: ${{ steps.base.outputs.WORKSPACE_ROOT }}
RUNNER: "Playwright"
FIXTURE: "sanity-test-playwright-docker.json"