Skip to content

more tests

more tests #14

name: Visual Comparison
on:
push:
branches: [visual-tests]
# on:
# push:
# paths:
# - 'src/**'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_SECRET_KEY }}
AWS_DEFAULT_REGION: us-east-1
APPZI_TOKEN: ${{ secrets.APPZI_TOKEN }}
MENDABLE_API_KEY: ${{ secrets.MENDABLE_API_KEY }}
FULLSTORY_ORGID: ${{ secrets.FULLSTORY_ORGID }}
ALGOLIA_ADMIN_KEY: ${{ secrets.ALGOLIA_ADMIN_KEY }}
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
ALGOLIA_SEARCH_KEY: ${{ secrets.ALGOLIA_SEARCH_KEY }}
concurrency:
group: "visual-comparison-${{ github.workflow }}"
cancel-in-progress: false
permissions:
contents: read
pages: write
id-token: write
jobs:
take-screenshots:
environment:
name: github-pages
url: ${{ steps.take-screenshots.outputs.page_url }}
name: Visual Comparison
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps chromium
- name: Build the website
run: make build
- name: Take screenshots with Playwright
run: make test-visual-ci
- name: Upload screenshots
uses: actions/upload-artifact@v4
id: screenshots
with:
name: "snapshots"
path: |
screenshots/screenshot.spec.ts-snapshots/
if-no-files-found: error
retention-days: 1
- name: Upload Report
uses: actions/upload-artifact@v4
id: report
with:
name: "report"
path: |
playwright-report/
if-no-files-found: error
retention-days: 1
- name: Download URLs
run: |
echo 'Screenshots URL is ${{ steps.screenshots.outputs.artifact-url }}'
echo 'Report URL is ${{ steps.report.outputs.artifact-url }}'
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Unique Folder name
run : mkdir ${{ github.sha }} && cp -r playwright-report/* ${{ github.sha }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ github.sha }}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: GH Pages URL
run: echo "https://spectrocloud.github.io/docs.spectrocloud.com/${{ github.sha }}/playwright-report/index.html"