Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
command: npm run test:a11y -w packages/stacks-classic -- --config web-test-runner.config.ci.mjs
needs_lfs: false
needs_playwright: true
- command_description: Visual Regression Tests
command: npm run test:visual:ci -w packages/stacks-classic -- --config ./visual-runner/stacks-classic-runner-config/web-test-runner.config.ci.mjs
needs_lfs: true
needs_playwright: false # we are using playwright docker image to run visual tests
- command_description: Unit Tests (stacks-svelte)
command: npm run test -w packages/stacks-svelte
needs_lfs: false
Expand All @@ -53,17 +49,28 @@
needs_lfs: ${{ matrix.needs_lfs }}
secrets: inherit

visual-regression-tests:
name: Visual Regression Tests
uses: ./.github/workflows/test-visual-regression.yml
secrets: inherit

release:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
name: Release (latest or beta)
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta'
needs: [build-and-test]
if: >-
${{
!cancelled() &&
(github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/beta') &&
needs.build-and-test.result == 'success' &&
(needs.visual-regression-tests.result == 'success' || needs.visual-regression-tests.result == 'skipped')
}}
needs: [build-and-test, visual-regression-tests]
runs-on: ubuntu-latest
outputs:
published: ${{ steps.changesets.outputs.published }}
steps:
- uses: actions/checkout@v5
- name: Setup Node.js environment
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: lts/*
cache: "npm"
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/test-visual-regression.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Visual Regression Tests
run-name: Visual Regression Tests

on:
workflow_call:

jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.filter.outputs.run }}
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v5

- name: Detect Stacks Classic changes
id: filter
uses: dorny/paths-filter@v4
with:
filters: |
run:
- 'packages/stacks-classic/**'

visual-regression-tests:
Comment thread
dancormier marked this conversation as resolved.
Dismissed
name: Visual Regression Tests
needs: changes
if: needs.changes.outputs.should_run == 'true'
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v5
with:
lfs: true

- name: ⎔ Setup node
uses: actions/setup-node@v5
with:
node-version: 'lts/*'

- name: 🏗 Install Dependencies
run: npm ci

- name: 🔑 Setup SSH for private submodule
run: |
mkdir -p ~/.ssh
echo -e "${SUBMODULE_SSH_KEY//_/\\n}" > ~/.ssh/id_rsa
chmod og-rwx ~/.ssh/id_rsa
env:
SUBMODULE_SSH_KEY: ${{ secrets.SUBMODULE_SSH_KEY }}

- name: ▶️ Visual Regression Tests
run: npm run test:visual:ci -w packages/stacks-classic -- --config ./visual-runner/stacks-classic-runner-config/web-test-runner.config.ci.mjs
env:
BETTER_AUTH_SECRET: ${{ secrets.AUTH_SECRET || 'ci-build-placeholder-secret' }}

- name: ⬆️ Upload Visual Regression Test Results
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: visual-regression-test-results
path: packages/stacks-classic/screenshots
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
dancormier marked this conversation as resolved.
Dismissed
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
lfs: ${{ inputs.needs_lfs }}

- name: ⎔ Setup node
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: 'lts/*'

Expand Down
Loading