Skip to content

Commit b04d3a5

Browse files
chore/UIDS-443 Add nightly Percy run in GitHub actions (#473)
1 parent 11dd94b commit b04d3a5

File tree

3 files changed

+35
-7
lines changed

3 files changed

+35
-7
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: "Run Nightly Percy Tests"
2+
on:
3+
schedule:
4+
- cron: "0 0 * * *"
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
env:
9+
FONTAWESOME_NPM_AUTH_TOKEN: ${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@master
13+
- run: npm config set "@fortawesome:registry" https://npm.fontawesome.com/
14+
- run: npm config set "//npm.fontawesome.com/:_authToken" $FONTAWESOME_NPM_AUTH_TOKEN
15+
- name: Install
16+
run: yarn
17+
- run: npm install -g wait-on
18+
- run: yarn storybook & wait-on http://localhost:9009
19+
- name: Percy Test
20+
uses: percy/[email protected]
21+
with:
22+
command: "cypress run"
23+
env:
24+
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,16 @@ Trigger a production build when files are changed.
107107
Remove symlinked packages.
108108
### Visual testing
109109

110-
1. Join BrowserStack (ask Brian for link)
111-
1. Navigate to this project in percy [here](https://percy.io/f38ae9b9/ui-design-system)
112-
1. Define `PERCY_TOKEN` in shell (the one from ui-design-system project)
113-
1. `npx percy exec -- cypress run`
114-
1. View results in percy.io / console
110+
1. Join BrowserStack team (ask Brian/Bob for link)
111+
1. Navigate to this project in [Percy](https://percy.io/f38ae9b9/ui-design-system)
115112

116-
> Note- we are on the free plan (5k images/month) so be mindful of the limit
113+
## Local setup
114+
1. Define `PERCY_TOKEN` ENV (the one from ui-design-system project found above)
115+
1. Run `yarn storybook` in one tab
116+
1. Run `npx percy exec -- cypress run` in another
117+
1. View results in percy.io & console
118+
119+
> Note- we are running this once a day via github actions.
117120
118121
## Pull requests
119122

cypress.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"baseUrl": "http://localhost:9009/?path=/story/",
3-
"experimentalStudio": true
3+
"experimentalStudio": true,
4+
"video": false
45
}

0 commit comments

Comments
 (0)