Skip to content

Commit

Permalink
Create percy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Champion authored Apr 24, 2020
1 parent d99efe8 commit 7b0a63f
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/percy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Percy
on:
pull_request:
types:
- labeled
- opened
- reopened
- synchronize
push:
branches: master
jobs:
percy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12.x
- if: contains(github.event.pull_request.labels.*.name, 'percy') || endsWith(github.ref, '/master')
run: npx origami-build-tools install
- if: contains(github.event.pull_request.labels.*.name, 'percy') || endsWith(github.ref, '/master')
run: npx origami-build-tools demo
- if: contains(github.event.pull_request.labels.*.name, 'percy') || endsWith(github.ref, '/master')
name: Percy Test
uses: percy/[email protected]
with:
build-directory: "demos/local"
env:
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
- if: contains(github.event.pull_request.labels.*.name, 'percy')
uses: actions/[email protected]
with:
github-token: ${{secrets.ORIGAMI_FOX_ACCESS_TOKEN}}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '👋 Percy has finished running the visual regression testing!'
})
- if: contains(github.event.pull_request.labels.*.name, 'percy')
uses: actions/[email protected]
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.removeLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['percy']
})

0 comments on commit 7b0a63f

Please sign in to comment.