Skip to content

Commit

Permalink
Merge branch 'next' into pr/16630
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Jan 3, 2022
2 parents aa75b47 + f32cdfd commit bba91d3
Show file tree
Hide file tree
Showing 1,163 changed files with 34,896 additions and 8,426 deletions.
2 changes: 1 addition & 1 deletion .babelrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const withTests = {
],
],
plugins: [
'babel-plugin-require-context-hook',
'@storybook/babel-plugin-require-context-hook',
'babel-plugin-dynamic-import-node',
'@babel/plugin-transform-runtime',
],
Expand Down
21 changes: 4 additions & 17 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ jobs:
command: yarn wait-on http://localhost:6000
- run:
name: Run E2E tests
command: yarn test:e2e-framework --clean --all --skip angular11 --skip angular --skip vue3 --skip web_components_typescript --skip cra
command: yarn test:e2e-framework --clean --all --skip angular11 --skip angular --skip angular12 --skip vue3 --skip web_components_typescript --skip cra
no_output_timeout: 5m
- store_artifacts:
path: /tmp/cypress-record
Expand All @@ -221,7 +221,8 @@ jobs:
name: Run E2E tests
# Do not test CRA here because it's done in PnP part
# TODO: Remove `web_components_typescript` as soon as Lit 2 stable is released
command: yarn test:e2e-framework vue3 angular angular11 web_components_typescript web_components_lit2
# TODO: Add `angular` as soon as Storybook is compatible with Angular 13
command: yarn test:e2e-framework vue3 angular12 angular11 web_components_typescript web_components_lit2
no_output_timeout: 5m
- store_artifacts:
path: /tmp/cypress-record
Expand Down Expand Up @@ -249,7 +250,7 @@ jobs:
cd ..
npx create-react-app cra-bench
cd cra-bench
npx @storybook/bench 'npx sb init' --label cra --extra-flags "--modern"
npx @storybook/bench@latest 'npx sb init' --label cra --extra-flags "--modern"
e2e-tests-pnp:
executor:
class: medium
Expand Down Expand Up @@ -353,17 +354,6 @@ jobs:
command: |
cd examples/cra-react15
yarn storybook --smoke-test --quiet
frontpage:
executor: sb_node_12_browsers
steps:
- git-shallow-clone/checkout_advanced:
clone_options: '--depth 1 --verbose'
- run:
name: Install dependencies
command: yarn install --immutable
- run:
name: Trigger build
command: ./scripts/build-frontpage.js
lint:
executor:
class: small
Expand Down Expand Up @@ -446,6 +436,3 @@ workflows:
- cra-bench:
requires:
- publish
deploy:
jobs:
- frontpage
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
module.exports = {
root: true,
extends: ['@storybook/eslint-config-storybook'],
extends: ['@storybook/eslint-config-storybook', 'plugin:storybook/recommended'],
rules: {
'@typescript-eslint/ban-ts-comment': 'warn',
'jest/no-standalone-expect': [
'error',
{ additionalTestBlockFunctions: ['it.skipWindows', 'it.onWindows'] },
],
},
overrides: [
{
Expand Down
99 changes: 99 additions & 0 deletions .github/workflows/handle-release-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Handle Release Branches

on:
push:

jobs:
branch-checks:
runs-on: ubuntu-latest
steps:
- id: get-branch
run: |
BRANCH=($(echo ${{ github.ref }} | sed -E 's/refs\/heads\///'))
echo "branch=$BRANCH" >> $GITHUB_ENV
outputs:
branch: ${{ env.branch }}
is-latest-branch: ${{ env.branch == 'main' }}
is-next-branch: ${{ env.branch == 'next' }}
is-release-branch: ${{ startsWith(env.branch, 'release-') }}
is-actionable-branch: ${{ env.branch == 'main' || env.branch == 'next' || startsWith(env.branch, 'release-') }}

handle-latest:
needs: branch-checks
if: ${{ needs.branch-checks.outputs.is-latest-branch == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- run: curl -X POST "https://api.netlify.com/build_hooks/${{ secrets.FRONTPAGE_HOOK }}"

get-next-release-branch:
needs: branch-checks
if: ${{ needs.branch-checks.outputs.is-next-branch == 'true' || needs.branch-checks.outputs.is-release-branch == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: next
path: next

- id: next-version
uses: notiz-dev/github-action-json-property@release
with:
path: ${{ github.workspace }}/next/package.json
prop_path: version

- run: |
NEXT_RELEASE_BRANCH=($(echo ${{ steps.next-version.outputs.prop }} | sed -E 's/([0-9]+)\.([0-9]+).*/release-\1-\2/'))
echo "next-release-branch=$NEXT_RELEASE_BRANCH" >> $GITHUB_ENV
outputs:
branch: ${{ env.next-release-branch }}

create-next-release-branch:
needs: [branch-checks, get-next-release-branch]
if: ${{ needs.branch-checks.outputs.is-next-branch == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- run: |
set +e
REMOTE_BRANCH=$(git branch -r | grep origin/${{ needs.get-next-release-branch.outputs.branch }})
if [[ ! -z $REMOTE_BRANCH ]]; then git push origin --delete ${{ needs.get-next-release-branch.outputs.branch }}; fi
echo 'Pushing branch ${{ needs.get-next-release-branch.outputs.branch }}...'
git push -f origin ${{ needs.branch-checks.outputs.branch }}:${{ needs.get-next-release-branch.outputs.branch }}
outputs:
branch: ${{ needs.get-next-release-branch.outputs.branch }}

next-release-branch-check:
if: ${{ always() }}
needs: [branch-checks, get-next-release-branch]
runs-on: ubuntu-latest
steps:
- run: |
IS_NEXT_RELEASE_BRANCH=${{ needs.branch-checks.outputs.branch == needs.get-next-release-branch.outputs.branch }}
echo "is-next-release-branch=$IS_NEXT_RELEASE_BRANCH" >> $GITHUB_ENV
- if: ${{ env.is-next-release-branch == 'true' }}
run: echo "relevant-base-branch=next" >> $GITHUB_ENV

- if: ${{ env.is-next-release-branch == 'true' }}
run: |
echo 'WARNING: Do not push directly to the `${{ needs.branch-checks.outputs.branch }}` branch. This branch is created and force-pushed over after pushing to the `${{ env.relevant-base-branch }}` branch and the changes you just pushed will be lost.'
exit 1
outputs:
check: ${{ env.is-next-release-branch }}

request-create-frontpage-branch:
if: ${{ always() }}
needs: [branch-checks, next-release-branch-check, create-next-release-branch]
runs-on: ubuntu-latest
steps:
- if: ${{ needs.branch-checks.outputs.is-actionable-branch == 'true' && needs.branch-checks.outputs.is-latest-branch == 'false' && needs.next-release-branch-check.outputs.check == 'false' }}
run: |
curl -X POST https://api.github.com/repos/storybookjs/frontpage/dispatches \
-H 'Accept: application/vnd.github.v3+json' \
-u ${{ secrets.FRONTPAGE_ACCESS_TOKEN }} \
--data '{"event_type": "request-create-frontpage-branch", "client_payload": { "branch": "${{ needs.create-next-release-branch.outputs.branch || needs.branch-checks.outputs.branch }}" }}'
27 changes: 27 additions & 0 deletions .github/workflows/linear-export.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Export to linear

on:
issues:
types: [labeled]
pull_request:
types: [labeled]

jobs:
trigger:
if: github.event.label.name == 'linear'
name: Export to linear
runs-on: ubuntu-latest
steps:
# - uses: hmarr/debug-action@v2
- name: Linear action
uses: shilman/linear-action@v1
with:
ghIssueNumber: ${{ github.event.number || github.event.issue.number }}
ghRepoOwner: ${{ github.event.repository.owner.login }}
ghRepoName: ${{ github.event.repository.name }}
ghToken: ${{ secrets.LINEAR_GH_TOKEN }}
linearIssuePrefix: SB
linearLabel: Storybook
linearPRLabel: PR
linearTeam: CH
linearApiKey: ${{ secrets.LINEAR_API_KEY }}
27 changes: 22 additions & 5 deletions .github/workflows/tests-unit.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
name: Unit tests

on: [push]
on:
push:
branches:
- next
pull_request:
types: [opened, reopened, labeled, synchronize]

jobs:
build:
name: Core Unit Tests
runs-on: ubuntu-latest
name: Core Unit Tests node-${{ matrix.node_version }}, ${{ matrix.os }}
if: ${{ github.event.label.name == 'ci:matrix' || github.event.type == 'push' }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
node_version: [12, 14, 16]
include:
- os: macos-latest
node_version: 16
- os: windows-latest
node_version: 16
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@v2
with:
node-version: "12.x"
node-version: ${{ matrix.node_version }}
cache: yarn
- name: install, bootstrap
run: |
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dist
.tern-port
*.DS_Store
.cache
.parcel-cache
coverage/
*.lerna_backup
build
Expand Down Expand Up @@ -41,4 +42,4 @@ examples/angular-cli/addon-jest.testresults.json
!/**/.yarn/plugins
!/**/.yarn/sdks
!/**/.yarn/versions
/**/.pnp.*
/**/.pnp.*
30 changes: 0 additions & 30 deletions .teamcity/settings.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ project {
buildType(Build)
buildType(E2E)
buildType(SmokeTests)
buildType(Frontpage)
buildType(Test)
buildType(Coverage)

Expand All @@ -56,7 +55,6 @@ project {
RelativeId("Build"),
RelativeId("E2E"),
RelativeId("SmokeTests"),
RelativeId("Frontpage"),
RelativeId("Test"),
RelativeId("Coverage")
)
Expand Down Expand Up @@ -403,34 +401,6 @@ object SmokeTests : BuildType({
}
})

object Frontpage : BuildType({
name = "Frontpage"
type = Type.DEPLOYMENT

steps {
script {
scriptContent = """
#!/bin/bash
set -e -x
yarn install --immutable
yarn bootstrap --install
node ./scripts/build-frontpage.js
""".trimIndent()
dockerImage = "node:12"
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
}
}

triggers {
vcs {
quietPeriodMode = VcsTrigger.QuietPeriodMode.USE_DEFAULT
triggerRules = "-:.teamcity/**"
branchFilter = "+:main"
}
}
})

object Test : BuildType({
name = "Test"

Expand Down

0 comments on commit bba91d3

Please sign in to comment.