Skip to content
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

CI: Schedule a daily job that runs all sandboxes #19699

Merged
merged 2 commits into from
Nov 3, 2022
Merged
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
128 changes: 110 additions & 18 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
version: 2.1

parameters:
workflow:
description: Which workflow to run
type: enum
enum: ['tests', 'daily-tests']
default: 'tests'

executors:
sb_node_16_classic:
parameters:
Expand Down Expand Up @@ -169,7 +176,7 @@ jobs:
destination: sb-bench.tar.gz
react-vite-bench:
executor:
class: medium
class: large
name: sb_playwright
working_directory: /tmp/storybook
steps:
Expand Down Expand Up @@ -246,12 +253,12 @@ jobs:
name: Test
command: |
cd scripts
yarn test --coverage --runInBand --ci
yarn test --coverage --ci
- store_test_results:
path: scripts/junit.xml
unit-tests:
executor:
class: medium+
class: xlarge
yannbf marked this conversation as resolved.
Show resolved Hide resolved
name: sb_node_16_browsers
steps:
- git-shallow-clone/checkout_advanced:
Expand All @@ -262,7 +269,7 @@ jobs:
name: Test
command: |
cd code
yarn test --coverage --runInBand --ci
yarn test --coverage --ci
- store_test_results:
path: code/junit.xml
- persist_to_workspace:
Expand Down Expand Up @@ -302,109 +309,194 @@ jobs:
path: test-results
## new workflow
create-sandboxes:
parameters:
parallelism:
type: integer
default: 9
cadence:
type: enum
enum: [ "ci", "daily", "weekly" ]
default: "ci"
executor:
class: medium
name: sb_node_16_browsers
parallelism: 9
parallelism: << parameters.parallelism >>
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
- run:
name: Creating Sandboxes
command: yarn task --task sandbox --template $(yarn get-template ci create) --no-link --start-from=never --junit
command: yarn task --task sandbox --template $(yarn get-template << parameters.cadence >> create) --no-link --start-from=never --junit
- persist_to_workspace:
root: .
paths:
- sandbox
- store_test_results:
path: test-results
smoke-test-sandboxes:
parameters:
parallelism:
type: integer
default: 9
cadence:
type: enum
enum: [ "ci", "daily", "weekly" ]
default: "ci"
executor:
class: medium
name: sb_node_16_browsers
parallelism: 9
parallelism: << parameters.parallelism >>
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
- run:
name: Smoke Testing Sandboxes
command: yarn task --task smoke-test --template $(yarn get-template ci smoke-test) --no-link --start-from=never --junit
command: yarn task --task smoke-test --template $(yarn get-template << parameters.cadence >> smoke-test) --no-link --start-from=never --junit
- store_test_results:
path: test-results
build-sandboxes:
parameters:
parallelism:
type: integer
default: 9
cadence:
type: enum
enum: [ "ci", "daily", "weekly" ]
default: "ci"
executor:
class: medium+
name: sb_node_16_browsers
parallelism: 9
parallelism: << parameters.parallelism >>
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
- run:
name: Building Sandboxes
command: yarn task --task build --template $(yarn get-template ci build) --no-link --start-from=never --junit
command: yarn task --task build --template $(yarn get-template << parameters.cadence >> build) --no-link --start-from=never --junit
- store_test_results:
path: test-results
- persist_to_workspace:
root: .
paths:
- sandbox/*/storybook-static
test-runner-sandboxes:
parameters:
parallelism:
type: integer
default: 9
cadence:
type: enum
enum: [ "ci", "daily", "weekly" ]
default: "ci"
executor:
class: medium
name: sb_playwright
parallelism: 9
parallelism: << parameters.parallelism >>
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
- run:
name: Running Test Runner
command: yarn task --task test-runner --template $(yarn get-template ci test-runner) --no-link --start-from=never --junit
command: yarn task --task test-runner --template $(yarn get-template << parameters.cadence >> test-runner) --no-link --start-from=never --junit
- store_test_results:
path: test-results
chromatic-sandboxes:
parameters:
parallelism:
type: integer
default: 9
cadence:
type: enum
enum: ["ci", "daily", "weekly"]
default: "ci"
executor:
class: medium
name: sb_node_16_browsers
parallelism: 9
parallelism: << parameters.parallelism >>
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- checkout
- attach_workspace:
at: .
- run:
name: Running Chromatic
command: yarn task --task chromatic --template $(yarn get-template ci chromatic) --no-link --start-from=never --junit
command: yarn task --task chromatic --template $(yarn get-template << parameters.cadence >> chromatic) --no-link --start-from=never --junit
- store_test_results:
path: test-results
e2e-sandboxes:
parameters:
parallelism:
type: integer
default: 9
cadence:
type: enum
enum: ["ci", "daily", "weekly"]
default: "ci"
executor:
class: medium
name: sb_playwright
parallelism: 9
parallelism: << parameters.parallelism >>
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- attach_workspace:
at: .
- run:
name: Running E2E Tests
command: yarn task --task e2e-tests --template $(yarn get-template ci e2e-tests) --no-link --start-from=never --junit
command: yarn task --task e2e-tests --template $(yarn get-template << parameters.cadence >> e2e-tests) --no-link --start-from=never --junit
- store_test_results:
path: test-results
- store_artifacts: # this is where playwright puts more complex stuff
path: code/playwright-results/
destination: playwright

workflows:
daily-tests:
when:
equal: [ daily-tests, << pipeline.parameters.workflow >> ]
jobs:
- build
- publish:
requires:
- build
- create-sandboxes:
parallelism: 24
cadence: "daily"
requires:
- publish
# - smoke-test-sandboxes: # disabled for now
# requires:
# - create-sandboxes
- build-sandboxes:
parallelism: 24
cadence: "daily"
requires:
- create-sandboxes
- test-runner-sandboxes:
parallelism: 24
cadence: "daily"
requires:
- build-sandboxes
- chromatic-sandboxes:
parallelism: 24
cadence: "daily"
requires:
- build-sandboxes
- e2e-sandboxes:
parallelism: 24
cadence: "daily"
requires:
- build-sandboxes
test:
when:
equal: [ tests, << pipeline.parameters.workflow >> ]
jobs:
- build
- lint:
Expand Down