|
| 1 | +# CircleCI configuration |
| 2 | + |
| 3 | +This directory contains the CircleCI configuration for the Storybook project. The CircleCI configuration is split across multiple files and packed into a single `config.yml` using the `circleci config pack` command. This approach follows the [FYAML specification](https://github.com/CircleCI-Public/fyaml) for decomposing large YAML documents into multiple files. |
| 4 | + |
| 5 | +### Packing process |
| 6 | + |
| 7 | +To regenerate (pack) the CircleCI config file and validate it: |
| 8 | + |
| 9 | +```bash |
| 10 | +circleci config pack .circleci/src > .circleci/config.yml |
| 11 | +circleci config validate .circleci/config.yml |
| 12 | +``` |
| 13 | + |
| 14 | +Commit the updated `config.yml` like any other file. |
| 15 | + |
| 16 | +You will need the [CircleCI local CLI](https://circleci.com/docs/local-cli/#installation). For more details on config packing, see the [CircleCI documentation](https://circleci.com/docs/how-to-use-the-circleci-local-cli/#packing-a-config). |
| 17 | + |
| 18 | +### Local testing |
| 19 | + |
| 20 | +To test individual jobs locally: |
| 21 | + |
| 22 | +```bash |
| 23 | +circleci config process .circleci/config.yml > process.yml |
| 24 | +circleci local execute -c process.yml <job-name> |
| 25 | +``` |
| 26 | + |
| 27 | +You will need to have Docker installed to be able to do this. See the [CircleCI docs](https://circleci.com/docs/how-to-use-the-circleci-local-cli/#run-a-job-in-a-container-on-your-machine) for details and limitations. |
| 28 | + |
| 29 | +## Configuration overview |
| 30 | + |
| 31 | +The Storybook CircleCI setup is a multi-workflow system designed to test Storybook across multiple frameworks, bundlers, and package managers. |
| 32 | + |
| 33 | +### Parameters |
| 34 | + |
| 35 | +The configuration accepts several pipeline parameters: |
| 36 | + |
| 37 | +- **`workflow`**: Which workflow to run (`normal`, `merged`, `daily`, `skipped`, `docs`) |
| 38 | +- **`ghPrNumber`**: GitHub PR number for PR-specific testing |
| 39 | +- **`ghBaseBranch`**: Base branch name for comparison testing |
| 40 | + |
| 41 | +### Workflows |
| 42 | + |
| 43 | +- **`normal`**: Standard PR checks, running the most important sandboxes |
| 44 | +- **`merged`**: Post-merge PR checks, running against more sandboxes |
| 45 | +- **`daily`**: Daily job, running against even more sandboxes and empty directory |
| 46 | +- **`docs`**: Documentation checks |
| 47 | + |
| 48 | +### Jobs |
| 49 | + |
| 50 | +- **`build`**: Compiles code, publishes to local Verdaccio registry |
| 51 | +- **`lint`**: ESLint + Prettier checks |
| 52 | +- **`knip`**: Unused dependency detection |
| 53 | +- **`check`**: Type checking and validation |
| 54 | +- **`unit-tests`**: Vitest-based unit tests |
| 55 | +- **`e2e-ui`**: End-to-end tests for Storybook's manager UI |
| 56 | +- **`test-init-empty`**: Tests Storybook init from empty directories |
| 57 | +- **`test-init-features`**: Tests Storybook initialization with features |
| 58 | +- **`test-portable-stories`**: Tests portable stories across frameworks |
| 59 | +- **`create-sandboxes`**: Generates framework-specific test environments (sandboxes) |
| 60 | +- **`chromatic-sandboxes`**: Visual regression testing against each sandbox |
| 61 | +- **`e2e-dev`**: End-to-end tests against a Storybook dev server for each sandbox |
| 62 | +- **`e2e-production`**: End-to-end tests against static production Storybooks for each sandbox |
| 63 | +- **`test-runner-production`**: Run the Test Runner against each sandbox |
| 64 | +- **`vitest-integration`**: Run the Vitest tests of each sandbox |
| 65 | + |
| 66 | +### TODOs |
| 67 | + |
| 68 | +Several jobs are currently disabled due to flakiness: |
| 69 | +- `bench-sandboxes`: Performance benchmarking |
| 70 | +- `test-runner-dev`: Dev mode test runner |
| 71 | +- `smoke-test-sandboxes`: Quick smoke tests |
| 72 | +- Some package managers in daily workflow |
0 commit comments