-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b23231
commit f9a6c3d
Showing
5 changed files
with
190 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Trigger a Percy test with comment "Percy!" | ||
|
||
name: 'Percy Visual Regression Tests' | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
jobs: | ||
build-and-test: | ||
# Run only if: | ||
# 1. The comment was made on a PR. | ||
# 2. The comment was exactly "Percy!" | ||
# 3. The PR is open. | ||
# 4. The comment was made by a member of our team. | ||
if: | | ||
github.event.issue.pull_request && | ||
github.event.comment.body == 'Percy!' && | ||
github.event.issue.state == 'open' && | ||
contains(fromJSON('["acermak", "addisonhardy", "laespinoza", "jamesray", "Scotchester", "stephiescastle", "JMancuso79"]'), github.event.comment.user.login) | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- name: React to PR comment | ||
uses: peter-evans/create-or-update-comment@v3 | ||
with: | ||
comment-id: ${{ github.event.comment.id }} | ||
reactions: '+1' | ||
|
||
- name: Checkout repository and submodules | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.ACCESS_TOKEN }} | ||
fetch-depth: 0 | ||
submodules: true | ||
|
||
- name: Get PR details | ||
id: pr-details | ||
uses: octokit/request-action@v2.x | ||
with: | ||
route: GET /repos/${{ github.repository }}/pulls/${{ github.event.issue.number }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.19.1 | ||
cache: npm | ||
|
||
- name: Install dependencies | ||
run: npm i --cpu x64 --os linux --include optional --ignore-scripts --package-lock false | ||
|
||
- name: Build Frontend Types | ||
run: cd apps/frontend && npx nuxi prepare | ||
|
||
- name: Build Storybook | ||
run: cd apps/storybook && npm run build:storybook | ||
|
||
- name: Run Percy | ||
id: run-percy | ||
env: | ||
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }} | ||
PERCY_PULL_REQUEST: ${{ github.event.issue.number }} | ||
PERCY_BRANCH: ${{ fromJson(steps.pr-details.outputs.data).head.ref }} | ||
run: | | ||
cd apps/storybook | ||
echo "PERCY_URL=$(npm run percy | grep -oP '(https:\/\/percy.io\/e5a03e0a\/smd-frontend(.*?(?=\s|$)))')" >> $GITHUB_ENV | ||
- name: Add comment to PR | ||
uses: peter-evans/create-or-update-comment@v3 | ||
with: | ||
issue-number: ${{ github.event.issue.number }} | ||
body: | | ||
${{ env.PERCY_URL != '' && ':hedgehog: Percy Test Results: ' || '❌ Percy was unable to run.' }} | ||
${{ env.PERCY_URL != '' && env.PERCY_URL || '' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
version: 2 | ||
snapshot: | ||
widths: | ||
- 375 | ||
- 1280 | ||
minHeight: 1024 | ||
percyCSS: '' | ||
disableShadowDOM: false | ||
enableJavascript: true | ||
enableLayout: true | ||
storybook: | ||
# args: {} | ||
# globals: {} | ||
# queryParams: {} | ||
# waitForTimeout: 30000 | ||
# waitForSelector: '' | ||
# additionalSnapshots: [] | ||
include: [ | ||
'Foundations/Typography: Text Styles', | ||
'Foundations/Themes: Dynamic Tokens', | ||
'Foundations/Logos/LogoTribrand: Logo Inline SVG', | ||
'Foundations/Grid and Layout: Full Page Example', | ||
# TODO: add a story that has all icons in it | ||
'Navigation/*', | ||
'Components/*', | ||
'Mixins/*', | ||
'Templates/*' | ||
] | ||
exclude: | ||
[ | ||
'Docs', | ||
'Overview', | ||
'Navigation/Headers/WWW/NavDesktop: Dropdown', | ||
'Navigation/Headers/WWW/NavMobile: With Secondary Nav', | ||
'Navigation/Headers/WWW/NavMobile: With Tertiary Nav', | ||
'Navigation/Headers/WWW/NavMobile: Dropdown Secondary', | ||
'Navigation/Headers/EDU/NavMobile', | ||
'Navigation/Elements', | ||
'Components/Base/BaseHeading', | ||
'Components/Base/BaseAudio: BaseAudio', | ||
'Components/Base/BaseImage: Lazy Loading', | ||
'Components/Base/BaseImagePlaceholder: With Image', | ||
'Components/Base/BaseModal: Base Story', | ||
'Components/Base/BaseModal: Custom Trigger', | ||
'Components/Base/BaseModal: Nested', | ||
'Components/Base/BaseSwimlane: Base Story', | ||
'Components/Base/BaseVideo: Base Story', | ||
'Components/Blocks/BlockCircleImageCard: Base Story', | ||
'Components/Blocks/BlockCta: Base Story', | ||
'Components/Blocks/BlockIframeEmbed: Lazy Load', | ||
'Components/Blocks/BlockImageCarousel/BlockImageCarouselItem: BlockImageCarouselItem', | ||
'Components/Blocks/BlockLinkCarousel: Two Items', | ||
'Components/Blocks/BlockLinkCarousel: Multiple Carousels', | ||
'Components/Heroes/Small: Video', | ||
'Snapshot found: Components/Heroes/Small: HeroMedium (compact)', | ||
'Components/WWW/Homepage/HomepageCarousel: Carousel with shuffled items', | ||
'Components/WWW/Homepage/HomepageCarousel: Carousel with few slides', | ||
'Components/WWW/Homepage/HomepageCarousel/HomepageCarouselItem: Single Item', | ||
'Components/WWW/Homepage/HomepageCarousel/HomepageCarouselItem: With Video', | ||
'Components/WWW/Homepage/HomepageMissionsCarousel: Item', | ||
'Components/WWW/MissionDetail/MissionDetailHero: Ecostress', | ||
'Components/WWW/MissionDetail/MissionDetailHero: Jason 3', | ||
'Components/WWW/MissionDetail/MissionDetailHero: Oco 2', | ||
'Components/WWW/MissionDetail/MissionHighlights: Mars 1', | ||
'Components/WWW/MissionDetail/MissionHighlights: Mars 2', | ||
'Components/WWW/MissionDetail/MissionHighlights: Moon', | ||
'Components/WWW/MissionDetail/MissionHighlights: Jupiter', | ||
'Components/WWW/TopicDetail/MissionCarousel/TopicDetailMissionCarouselItem: Base Story', | ||
'Components/WWW/TopicDetail/TopicDetailMore: No List', | ||
'Components/WWW/TopicDetail/TopicDetailMore: No Spotlight', | ||
'Components/WWW/TopicDetail/TopicDetailMore: Short List', | ||
'Mixins/MixinCarousel: BaseCarousel' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.