Skip to content

Commit fa708cb

Browse files
authored
Revert vistest (#7559)
Revert the `/vistest` workflow until we can resolve the Chromatic action not triggering for the `issue_comment` event. Current workflow error: ``` Error: issue_comment event is not supported in this action ``` Referenced issue feature request: chromaui/chromatic-cli#668
1 parent c45a253 commit fa708cb

File tree

3 files changed

+47
-84
lines changed

3 files changed

+47
-84
lines changed

.github/CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ We recommend running tests as well as trying your build of a package in a real p
155155

156156
- `yarn test` will run tests for all packages
157157
- `yarn turbo run test --filter="[HEAD^1]"` will test any package that has changed in the last commit
158-
- Run visual testing via adding the `/vistest` comment in a PR
159158

160159
You can test your changes in another project locally by creating a [snapshot release](https://github.com/Shopify/polaris/blob/main/documentation/Releasing.md#snapshot-release).
161160

.github/workflows/vistest.yml renamed to .github/workflows/ci-a11y-vrt.yml

Lines changed: 47 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,63 @@
1-
name: Visual Regression Tests
1+
name: Accessibility and Visual Regression Tests
22

33
on:
4-
issue_comment:
5-
types:
6-
- created
4+
push:
5+
branches:
6+
- main
7+
- next
8+
paths:
9+
- 'polaris-react/src/**'
10+
- 'polaris-react/playground/**'
11+
- 'polaris-tokens/src/**'
12+
pull_request:
13+
paths:
14+
- 'polaris-react/src/**'
15+
- 'polaris-react/playground/**'
16+
- 'polaris-tokens/src/**'
717

818
jobs:
9-
visual_regression_test:
10-
name: 'Visual regression test'
11-
if: |
12-
github.event.issue.pull_request && github.event.comment.body == '/vistest'
19+
accessibility_test:
20+
name: 'Accessibility test'
1321
runs-on: ubuntu-latest
1422
steps:
15-
- name: Enforce permission requirement
16-
uses: prince-chrismc/check-actor-permissions-action@v1
23+
- name: Checkout branch
24+
uses: actions/checkout@v3
25+
26+
- name: Setup Node with v16.13.0
27+
uses: actions/setup-node@v3
1728
with:
18-
permission: write
29+
node-version: 16.13.0
30+
cache: yarn
1931

20-
- name: Validate pull request is not on forked repo
21-
uses: actions/github-script@v6
22-
id: pr_data
23-
env:
24-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
- name: Restore cache
33+
uses: actions/cache@v3
2534
with:
26-
script: |
27-
try {
28-
const pullRequest = await github.rest.pulls.get({
29-
owner: context.repo.owner,
30-
repo: context.repo.repo,
31-
pull_number: context.issue.number,
32-
})
35+
path: |
36+
**/.turbo
37+
node_modules/.cache/turbo
38+
polaris-react/build-internal/cache
39+
key: ${{ runner.os }}-accessibility-test-v1-${{ github.sha }}
40+
restore-keys: |
41+
${{ runner.os }}-accessibility-test-v1-
3342
34-
// Pull request from fork
35-
if (context.payload.repository.full_name !== pullRequest.data.head.repo.full_name) {
36-
const errorMessage = '`/vistest` is not supported on pull requests from forked repositories.'
43+
- name: Install dependencies
44+
run: yarn --frozen-lockfile
45+
46+
- name: Build packages
47+
run: yarn turbo run build --filter=@shopify/polaris
3748

38-
await github.rest.issues.createComment({
39-
issue_number: context.issue.number,
40-
owner: context.repo.owner,
41-
repo: context.repo.repo,
42-
body: errorMessage,
43-
})
49+
- name: Build Storybook
50+
run: yarn workspace @shopify/polaris run storybook:build --quiet
4451

45-
core.setFailed(errorMessage)
46-
}
47-
} catch (err) {
48-
core.setFailed(`Request failed with error ${err}`)
49-
}
52+
- name: Run accessibility test
53+
run: node ./polaris-react/scripts/accessibility-check.js
54+
env:
55+
STORYBOOK_DISABLE_DOCS: 1
5056

57+
visual_regression_test:
58+
name: 'Visual regression test'
59+
runs-on: ubuntu-latest
60+
steps:
5161
- name: Checkout branch
5262
uses: actions/checkout@v3
5363
with:

.github/workflows/ci-a11y.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)