Skip to content

Commit

Permalink
Merge pull request #714 from Atom-Learning/feat/set-up-ci-for-vr-tests
Browse files Browse the repository at this point in the history
Feat: Add github workflow file for visual regression
  • Loading branch information
avirati authored Dec 17, 2024
2 parents e395e81 + 9cd02ec commit 318ccf9
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/visual-regression.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Visual Regression

on:
workflow_call:
inputs:
dsDocumentationUrl:
description: 'URL of environment to run VR tests against. Should include protocol (e.g. https://)'
required: false
default: ''
type: string

permissions:
actions: write
contents: read
pull-requests: write

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false

- name: Setup Node.js environment
uses: actions/setup-node@v2.1.4
with:
node-version: '20.11'

- name: Install Dependencies
run: yarn install

- name: Build Library
if: ${{ inputs.dsDocumentationUrl != '' }}
run: yarn build:lib

- name: Build Documentation
if: ${{ inputs.dsDocumentationUrl != '' }}
run: yarn build:docs

- name: Start Web Server as a Daemon
if: ${{ inputs.dsDocumentationUrl != '' }}
run: |
yarn start:docs &
disown -h %1
- name: Install Playwright browsers + dependencies
run: yarn playwright install --with-deps

- name: Run Visual Regression
run: yarn visual-regression
env:
DS_DOCUMENTATION_URL: '${{ inputs.dsDocumentationUrl }}'
ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
!.yarn/versions

playwright-report
test-results
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
"dev:sandbox": "cd lib && yarn start:sandbox",
"build:types": "cd lib && NODE_ENV=production tsc --emitDeclarationOnly && tsc-alias",
"lint-staged": "cd lib && yarn run precommit",
"build-all": "run-s build:*"
"build-all": "run-s build:*",
"visual-regression": "echo 'vr:chromium'"
},
"devDependencies": {
"husky": "^4.3.8",
Expand Down

0 comments on commit 318ccf9

Please sign in to comment.