Skip to content

Commit

Permalink
Introduce ci:normal label
Browse files Browse the repository at this point in the history
Co-authored-by: Kasper Peulen <[email protected]>
  • Loading branch information
valentinpalkovic and kasperpeulen committed Jul 6, 2023
1 parent 97a2b89 commit 0a58cc6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 79 deletions.
59 changes: 3 additions & 56 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ parameters:
workflow:
description: Which workflow to run
type: enum
enum: ['ci', 'pr', 'merged', 'daily']
default: 'ci'
enum: ['pr', 'merged', 'daily']
default: 'pr'

executors:
sb_node_16_classic:
Expand Down Expand Up @@ -257,7 +257,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: medium
name: sb_node_16_browsers
Expand All @@ -282,7 +281,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: medium
name: sb_node_16_browsers
Expand All @@ -303,7 +301,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: large
name: sb_node_16_browsers
Expand Down Expand Up @@ -338,7 +335,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: medium
name: sb_playwright
Expand All @@ -359,7 +355,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: large
name: sb_playwright
Expand All @@ -380,7 +375,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: medium
name: sb_node_16_browsers
Expand All @@ -400,7 +394,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: medium
name: sb_playwright
Expand All @@ -424,7 +417,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: medium
name: sb_playwright
Expand All @@ -448,7 +440,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: medium
name: sb_playwright
Expand All @@ -468,51 +459,6 @@ jobs:
template: $(yarn get-template --cadence << pipeline.parameters.workflow >> --task bench)

workflows:
ci:
when:
and:
- equal: [api, << pipeline.trigger_source >>]
- equal: [ci, << pipeline.parameters.workflow >>]
jobs:
- pretty-docs
- build
- lint:
requires:
- build
- check:
requires:
- build
- unit-tests:
requires:
- build
- script-unit-tests:
requires:
- build
- chromatic-internal-storybooks:
requires:
- build
- create-sandboxes:
requires:
- build
- build-sandboxes:
requires:
- create-sandboxes
- chromatic-sandboxes:
requires:
- build-sandboxes
- e2e-production:
requires:
- build-sandboxes
- e2e-dev:
requires:
- create-sandboxes
- test-runner-production:
requires:
- build-sandboxes
# TODO: reenable once we find out the source of flakyness
# - test-runner-dev:
# requires:
# - create-sandboxes
pr:
when:
equal: [pr, << pipeline.parameters.workflow >>]
Expand Down Expand Up @@ -554,6 +500,7 @@ workflows:
requires:
- build-sandboxes
- e2e-dev:
parallelism: 2
requires:
- create-sandboxes
- test-runner-production:
Expand Down
3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ Closes #

#### Maintainers

- [ ] If this PR should be tested against many or all sandboxes,
make sure to add the `ci:merged` or `ci:daily` GH label to it.
- [ ] When this PR is ready for testing, make sure to add `ci:normal`, `ci:merged` or `ci:daily` GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in `code/lib/cli/src/sandbox-templates.ts`
- [ ] Make sure this PR contains **one** of the labels below.

`["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]`
Expand Down
23 changes: 2 additions & 21 deletions .github/workflows/trigger-circle-ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,10 @@ jobs:
outputs:
branch: ${{ env.branch }}

trigger-ci-tests:
runs-on: ubuntu-latest
needs: get-branch
if: github.event_name == 'pull_request_target' && github.event.pull_request.draft == true && !contains(github.event.pull_request.labels.*.name, 'ci:pr') && !contains(github.event.pull_request.labels.*.name, 'ci:merged') && !contains(github.event.pull_request.labels.*.name, 'ci:daily')
steps:
- name: Trigger draft PR tests
run: >
curl -X POST --location "https://circleci.com/api/v2/project/gh/storybookjs/storybook/pipeline" \
-H "Content-Type: application/json" \
-H "Circle-Token: $CIRCLE_CI_TOKEN" \
-d '{
"branch": "'"$BRANCH"'",
"parameters": {
"workflow": "ci"
}
}'
env:
CIRCLE_CI_TOKEN: ${{ secrets.CIRCLE_CI_TOKEN }}
BRANCH: ${{ needs.get-branch.outputs.branch }}
trigger-pr-tests:
runs-on: ubuntu-latest
needs: get-branch
if: github.event_name == 'pull_request_target' && (((github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'release')) || contains(github.event.pull_request.labels.*.name, 'ci:pr')) && !contains(github.event.pull_request.labels.*.name, 'ci:merged') && !contains(github.event.pull_request.labels.*.name, 'ci:daily'))
if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:normal')
steps:
- name: Trigger PR tests
run: >
Expand All @@ -73,7 +54,7 @@ jobs:
trigger-merged-tests:
runs-on: ubuntu-latest
needs: get-branch
if: github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'ci:merged') && !contains(github.event.pull_request.labels.*.name, 'ci:daily'))
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'ci:merged')
steps:
- name: Trigger merged tests
run: >
Expand Down

0 comments on commit 0a58cc6

Please sign in to comment.