Skip to content

Commit

Permalink
refactor(github): moves puppeteer and playwright into individual smok…
Browse files Browse the repository at this point in the history
…e/sanity test jobs
  • Loading branch information
dgrebb committed Nov 26, 2023
1 parent 0a3cbc3 commit 77da8d0
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 5 deletions.
49 changes: 47 additions & 2 deletions .github/workflows/docker-sanity-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,53 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
sanity-test-docker:
name: 🤪 Sanity
sanity-test-puppeteer:
name: 🤪 Puppeteer Sanity
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref || github.ref }}

- name: Set Name and Tag Vars
env:
name: "${{ env.BRANCH_NAME }}"
run: |
echo "IMAGE_NAME_LC=${IMAGE_NAME,,}" >>${GITHUB_ENV}
echo "TAG=${name/\//-}" >> $GITHUB_ENV
echo "PV=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
echo "PLAYWRIGHT_VERSION=$(cat package.json | jq -r '.dependencies.playwright')" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: ⬢ Setup Node & Cache
uses: actions/setup-node@v3
with:
cache: "npm"
cache-dependency-path: package-lock.json

- name: ↧ Install
run: npm ci

- name: Pull Image
run: |
docker pull $REGISTRY/$IMAGE_NAME_LC:$TAG
sanity-test-playwright:
name: 🤪 Playwright Sanity
runs-on: ubuntu-latest

permissions:
Expand Down
50 changes: 47 additions & 3 deletions .github/workflows/docker-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
sanity-test-docker:
name: 💨 Smoke
smoke-test-puppeteer:
name: 💨 Puppeteer Smoke
runs-on: ubuntu-latest

permissions:
Expand Down Expand Up @@ -68,7 +68,51 @@ jobs:
run: |
cd test/configs/ && docker run --rm -t --mount type=bind,source="$(pwd)",target=/src $REGISTRY/$IMAGE_NAME_LC:$TAG test --config=backstop_features
smoke-test-playwright:
name: 💨 Playwright Smoke
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref || github.ref }}

- name: Set Name and Tag Vars
env:
name: "${{ env.BRANCH_NAME }}"
run: |
echo "IMAGE_NAME_LC=${IMAGE_NAME,,}" >>${GITHUB_ENV}
echo "TAG=${name/\//-}" >> $GITHUB_ENV
echo "PV=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: ⬢ Setup Node & Cache
uses: actions/setup-node@v3
with:
cache: "npm"
cache-dependency-path: package-lock.json

- name: ↧ Install
run: npm ci

- name: Pull Image
run: |
docker pull $REGISTRY/$IMAGE_NAME_LC:$TAG
- name: 🎭 Playwright Smoke
continue-on-error: true
run: |
cd test/configs/ && docker run --rm -t -e PLAYWRIGHT_BROWSERS_PATH="/ms-playwright" --entrypoint='' --mount type=bind,source="$(pwd)",target=/src $REGISTRY/$IMAGE_NAME_LC:$TAG bash npx install playwright && backstop test --config=backstop_features_pw
cd test/configs/ && docker run --rm -t --entrypoint='' --mount type=bind,source="$(pwd)",target=/src $REGISTRY/$IMAGE_NAME_LC:$TAG sh -c "npm -g config set user root && chmod -R 777 /root && chmod -R 777 /opt/pw-browsers && npm i -D playwright && npx --allow-root --yes playwright@$PLAYWRIGHT_VERSION install && backstop test --config=backstop_features_pw"

0 comments on commit 77da8d0

Please sign in to comment.