Skip to content

Commit

Permalink
Implement a daily job
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpeulen committed Nov 3, 2022
1 parent 5eaf7d8 commit f21f382
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 16 deletions.
122 changes: 107 additions & 15 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 @@ -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:
test:
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
tests:
when:
equal: [ tests, << pipeline.parameters.workflow >> ]
jobs:
- build
- lint:
Expand Down
4 changes: 3 additions & 1 deletion code/renderers/preact/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { parameters as docsParams } from './docs/config';

export { renderToDOM, render } from './render';

export const parameters = { framework: 'preact' as const };
export const parameters = { framework: 'preact' as const, ...docsParams };
5 changes: 5 additions & 0 deletions code/renderers/preact/src/docs/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const parameters = {
docs: {
inlineStories: true,
},
};

0 comments on commit f21f382

Please sign in to comment.