-
Notifications
You must be signed in to change notification settings - Fork 1
Add Argos visual tests alongside Chromatic #765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
df168ba
Add Argos visual tests alongside Chromatic
nedtwigg 2221f3b
Regenerate tend workflows at 0.2.15 for the Argos watch
nedtwigg 1a1be8e
Merge remote-tracking branch 'origin/main' into argos-ci
nedtwigg 4c12c99
Simplify the Argos setup and answer review
nedtwigg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,86 @@ | ||
| name: Argos | ||
|
|
||
| # Runs beside Chromatic while Argos is evaluated as its replacement: same | ||
| # stories, and the same triggers and draft and fork gates as `chromatic.yml`, | ||
| # whose comments give the reasons. Argos renders in this job | ||
| # (Playwright, via the Storybook Vitest addon) rather than in its own cloud, so | ||
| # a play-function exception fails the run here instead of passing silently. | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'lib/**' | ||
| - 'docs/stories/**' | ||
| - 'pnpm-lock.yaml' | ||
| - 'dor/**' | ||
| - 'remote-lib-common/**' | ||
| - 'dor-lib-common/**' | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
| paths: | ||
| - 'lib/**' | ||
| - 'docs/stories/**' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| # Keyed by SHA on push so main never cancels: those builds are the baselines. | ||
| group: argos-${{ github.event.pull_request.number || github.sha }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| jobs: | ||
| argos: | ||
| name: Argos Visual Tests | ||
| if: >- | ||
| github.event_name != 'pull_request' | ||
| || (github.event.pull_request.draft == false | ||
| && github.event.pull_request.head.repo.full_name == github.repository) | ||
| runs-on: ubuntu-latest | ||
| # Unlike Chromatic's, this job does the rendering, and `--with-deps` runs an | ||
| # unbounded apt-get; without a cap a stalled mirror holds the runner 6h. | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 | ||
| with: | ||
| node-version-file: package.json | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0 | ||
|
|
||
| - name: Install dependencies | ||
| # Frozen, so the lockfile pins what runs in a job holding ARGOS_TOKEN. | ||
| run: pnpm install --frozen-lockfile | ||
| working-directory: lib | ||
|
|
||
| - name: Install browsers | ||
| run: pnpm exec playwright install --with-deps chromium webkit | ||
| working-directory: lib | ||
|
|
||
| - name: Capture and upload screenshots | ||
| # One Argos build per browser: `storybook-chromium`, `storybook-webkit`. | ||
| run: pnpm test:argos | ||
| working-directory: lib | ||
| env: | ||
| ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }} | ||
|
|
||
| # Publish even when a story fails capture, as Chromatic does, so one throwing | ||
| # `play` on main does not freeze the standing Storybook link. | ||
| - name: Build Storybook | ||
|
dormouse-bot marked this conversation as resolved.
|
||
| if: ${{ !cancelled() }} | ||
| run: pnpm build-storybook | ||
| working-directory: lib | ||
|
|
||
| - name: Deploy Storybook | ||
| if: ${{ !cancelled() }} | ||
| # main's deploy is the production one, the standing link to the Storybook. | ||
| run: pnpm exec argos deploy ./storybook-static ${{ github.ref == 'refs/heads/main' && '--prod' || '' }} | ||
| working-directory: lib | ||
| env: | ||
| ARGOS_TOKEN: ${{ secrets.ARGOS_TOKEN }} | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.