Skip to content

Commit 812c27c

Browse files
committed
ci: update automation for dual-workspace structure
- Update CircleCI config for 1st-gen and 2nd-gen paths - Modify GitHub workflows for monorepo structure - Update changeset configuration for dual-workspace - Add Cursor rules for contributor documentation
1 parent 9ccd740 commit 812c27c

File tree

10 files changed

+562
-405
lines changed

10 files changed

+562
-405
lines changed

.changeset/README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ find the full documentation for it [in our repository](https://github.com/change
88

99
Changesets are a way to manage versions and changelogs for monorepos. Each changeset:
1010

11-
- Describes changes made in one or more packages
12-
- Indicates the type of change (major, minor, patch)
13-
- Contains a brief markdown summary of the changes
11+
- Describes changes made in one or more packages
12+
- Indicates the type of change (major, minor, patch)
13+
- Contains a brief markdown summary of the changes
1414

1515
## How to Add a Changeset
1616

@@ -29,18 +29,25 @@ Changesets are a way to manage versions and changelogs for monorepos. Each chang
2929

3030
The command will create a new markdown file in the `.changeset` directory with your changes.
3131

32+
## Important: @spectrum-web-components/core and component updates
33+
34+
When making changes to `@spectrum-web-components/core`, you **must** also include the corresponding `@spectrum-web-components` component in the same changeset to ensure the changes appear in the component's changelog. This is because `@spectrum-web-components/core` changes are internal and don't automatically propagate to the component changelogs.
35+
36+
**Best practice**: Create a single changeset that includes both packages when updating core functionality that affects a specific component.
37+
3238
## Example Changeset
3339

3440
A typical changeset file looks like this:
3541

3642
```markdown
3743
---
44+
'@spectrum-web-components/core': patch
3845
'@spectrum-web-components/button': minor
3946
'@spectrum-web-components/theme': patch
4047
---
4148
42-
- **Added**: Added new variant `tertiary` to `<sp-button>` component [#9999](https://github.com/adobe/spectrum-web-components/pull/9999)
43-
- **Fixed**: Fixed `<sp-theme>` theme compatibility issues [#10000](https://github.com/adobe/spectrum-web-components/pull/10000)
49+
- **Added**: Added new variant `tertiary` to `<sp-button>` component [#9999](https://github.com/adobe/spectrum-web-components/pull/9999)
50+
- **Fixed**: Fixed `<sp-theme>` theme compatibility issues [#10000](https://github.com/adobe/spectrum-web-components/pull/10000)
4451
```
4552
4653
For our guidelines on writing changesets, see [our writing changesets guide](https://opensource.adobe.com/spectrum-web-components/guides/writing-changesets/).
@@ -61,6 +68,6 @@ We have a quick list of common questions to get you started engaging with this p
6168
6269
## Additional Resources
6370
64-
- [Changesets Documentation](https://github.com/changesets/changesets)
65-
- [Common Questions](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
66-
- [Detailed Release Process](https://github.com/changesets/changesets/blob/main/docs/detailed-explanation.md)
71+
- [Changesets Documentation](https://github.com/changesets/changesets)
72+
- [Common Questions](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
73+
- [Detailed Release Process](https://github.com/changesets/changesets/blob/main/docs/detailed-explanation.md)

.changeset/config.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,22 @@
77
}
88
],
99
"commit": false,
10-
"fixed": [["@spectrum-web-components/*"]],
11-
"linked": [],
10+
"fixed": [
11+
[
12+
"@spectrum-web-components/*",
13+
"!@spectrum-web-components/core",
14+
"!@spectrum-web-components/1st-gen",
15+
"!@spectrum-web-components/2nd-gen"
16+
]
17+
],
18+
"linked": [["@adobe/swc", "@spectrum-web-components/core"]],
1219
"access": "public",
1320
"baseBranch": "main",
1421
"updateInternalDependencies": "patch",
15-
"ignore": [],
22+
"ignore": [
23+
"@spectrum-web-components/1st-gen",
24+
"@spectrum-web-components/2nd-gen"
25+
],
1626
"snapshot": {
1727
"useCalculatedVersion": true,
1828
"prereleaseTemplate": "{tag}.{datetime}"

.circleci/config.yml

Lines changed: 69 additions & 51 deletions
Large diffs are not rendered by default.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
description: Useful for updating auto-generated navigation and validating links in the contributor docs
3+
alwaysApply: false
4+
---
5+
6+
# Contributor docs navigation and link validation
7+
8+
## When to apply this rule
9+
10+
Recognize and apply this rule when the user requests any of the following:
11+
- Update contributor docs navigation
12+
- Update nav / TOC / breadcrumbs in contributor docs
13+
- Regenerate contributor docs
14+
- Validate/verify links in contributor docs
15+
- Fix broken links in contributor docs
16+
- Any mention of "CONTRIBUTOR-DOCS" or "contributor docs" with "update", "nav", "links", or "verify"
17+
18+
## Instructions location
19+
20+
**Primary path:** `CONTRIBUTOR-DOCS/01_contributor-guides/07_authoring-contributor-docs/01_ai-agent-instructions.md`
21+
22+
## What to do
23+
24+
1. **Verify the instructions file exists** at the path above
25+
- If the file exists, read it and follow the instructions for "Role 1: Operator"
26+
- If the file does NOT exist, see "Self-correction procedure" below
27+
28+
2. **Follow the AI agent instructions** to:
29+
- Run the nav update script (which automatically validates links)
30+
- Handle any broken links that are reported
31+
- Report results to the user
32+
33+
## Self-correction procedure
34+
35+
If the instructions file is not found at the expected path:
36+
37+
1. Search for the file using: `glob_file_search` with pattern `**/ai-agent-instructions.md`
38+
2. Filter results to find the one in `CONTRIBUTOR-DOCS/` folder
39+
3. Read the found file to confirm it contains the nav update instructions
40+
4. **Update this rule file** with the new path by modifying the "Primary path" line above
41+
5. Inform the user that you've updated the rule with the new location
42+
6. Continue with the nav update process
43+
44+
## Quick reference
45+
46+
The nav update process typically involves:
47+
- Running a Node.js script in the authoring-contributor-docs folder
48+
- The script automatically updates breadcrumbs, TOC, and validates all links
49+
- If broken links are found, fix straightforward issues automatically
50+
- Only consult the user for ambiguous cases
51+
52+
Execution time is typically 20-200ms for the entire CONTRIBUTOR-DOCS tree.
Lines changed: 92 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,99 @@
11
name: Browser Performance Tests
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize, reopened]
4+
pull_request:
5+
types: [opened, synchronize, reopened]
66

77
permissions:
8-
contents: read
9-
pull-requests: write
8+
contents: read
9+
pull-requests: write
1010

1111
jobs:
12-
test-changed-packages:
13-
strategy:
14-
matrix:
15-
browser: [firefox, chrome]
16-
name: Compare performance to latest release on ${{ matrix.browser }}
17-
18-
# The job will only run if the pull request is from the same repository.
19-
# Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token.
20-
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
21-
runs-on: ubuntu-22.04
22-
steps:
23-
- name: Checkout main
24-
uses: actions/checkout@v4
25-
with:
26-
ref: main
27-
28-
- name: Checkout PR branch
29-
uses: actions/checkout@v4
30-
with:
31-
fetch-depth: 0 # Get full history
32-
33-
- name: Fetch main branch
34-
run: |
35-
git fetch origin main:main
36-
37-
- name: Setup Job and Install Dependencies
38-
uses: ./.github/actions/setup-job
39-
40-
- name: Check ChromeDriver Version
41-
if: matrix.browser == 'chrome'
42-
run: |
43-
echo "Checking ChromeDriver version..."
44-
npx chromedriver --version
45-
echo "Checking Chrome version..."
46-
google-chrome --version
47-
echo "Checking tachometer chromedriver version..."
48-
yarn tachometer --version
49-
50-
- name: Tachometer the changed packages
51-
run: yarn test:changed --browser=${{ matrix.browser }}
52-
53-
- name: Create a dummy file to ensure at least one results file exists
54-
run: touch tachometer.${{ matrix.browser }}-ran.txt
55-
56-
- name: Archive ${{ matrix.browser }} tachometer results
57-
id: upload-artifact
58-
uses: actions/upload-artifact@v4
59-
with:
60-
name: tachometer-results-${{ matrix.browser }}
61-
path: |
62-
tach-results.${{ matrix.browser }}.*.json
63-
tachometer.${{ matrix.browser }}-ran.txt
64-
65-
comment-performance:
66-
name: Comment tachometer performance results
67-
needs: [test-changed-packages]
68-
69-
# The job will only run if the pull request is from the same repository.
70-
# Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token.
71-
if: ${{ github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository }}
72-
runs-on: ubuntu-latest
73-
steps:
74-
- name: Checkout main
75-
uses: actions/checkout@v4
76-
with:
77-
ref: main
78-
79-
- name: Checkout PR branch
80-
uses: actions/checkout@v4
81-
with:
82-
fetch-depth: 2
83-
84-
- name: Setup Job and Install Dependencies
85-
uses: ./.github/actions/setup-job
86-
87-
- uses: actions/download-artifact@v4
88-
with:
89-
pattern: tachometer-results-*
90-
merge-multiple: true
91-
92-
- name: Post Tachometer Performance Comment
93-
uses: actions/github-script@v7
94-
with:
95-
script: |
96-
const { buildTachometerComment } = await import('${{ github.workspace }}/.github/scripts/build-tachometer-comment.js');
97-
const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js');
98-
const body = buildTachometerComment();
99-
commentOrUpdate(github, context, '## Tachometer results', body);
12+
test-changed-packages:
13+
strategy:
14+
matrix:
15+
browser: [firefox, chrome]
16+
name: Compare performance to latest release on ${{ matrix.browser }}
17+
18+
# The job will only run if the pull request is from the same repository.
19+
# Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token.
20+
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
21+
runs-on: ubuntu-22.04
22+
steps:
23+
- name: Checkout main
24+
uses: actions/checkout@v4
25+
with:
26+
ref: main
27+
28+
- name: Checkout PR branch
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 0 # Get full history
32+
33+
- name: Fetch main branch
34+
run: |
35+
git fetch origin main:main
36+
37+
- name: Setup Job and Install Dependencies
38+
uses: ./.github/actions/setup-job
39+
40+
- name: Check ChromeDriver Version
41+
if: matrix.browser == 'chrome'
42+
run: |
43+
echo "Checking ChromeDriver version..."
44+
npx chromedriver --version
45+
echo "Checking Chrome version..."
46+
google-chrome --version
47+
echo "Checking tachometer chromedriver version..."
48+
cd 1st-gen && yarn tachometer --version
49+
50+
- name: Tachometer the changed packages
51+
run: cd 1st-gen && yarn test:changed --browser=${{ matrix.browser }}
52+
53+
- name: Create a dummy file to ensure at least one results file exists
54+
run: touch 1st-gen/tachometer.${{ matrix.browser }}-ran.txt
55+
56+
- name: Archive ${{ matrix.browser }} tachometer results
57+
id: upload-artifact
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: tachometer-results-${{ matrix.browser }}
61+
path: |
62+
1st-gen/tach-results.${{ matrix.browser }}.*.json
63+
1st-gen/tachometer.${{ matrix.browser }}-ran.txt
64+
65+
comment-performance:
66+
name: Comment tachometer performance results
67+
needs: [test-changed-packages]
68+
69+
# The job will only run if the pull request is from the same repository.
70+
# Benchmarks can't run on PRs from forked repos due to comment posting restrictions without a GitHub token.
71+
if: ${{ github.event.pull_request == null || github.event.pull_request.head.repo.full_name == github.repository }}
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: Checkout main
75+
uses: actions/checkout@v4
76+
with:
77+
ref: main
78+
79+
- name: Checkout PR branch
80+
uses: actions/checkout@v4
81+
with:
82+
fetch-depth: 2
83+
84+
- name: Setup Job and Install Dependencies
85+
uses: ./.github/actions/setup-job
86+
87+
- uses: actions/download-artifact@v4
88+
with:
89+
pattern: tachometer-results-*
90+
merge-multiple: true
91+
92+
- name: Post Tachometer Performance Comment
93+
uses: actions/github-script@v7
94+
with:
95+
script: |
96+
const { buildTachometerComment } = await import('${{ github.workspace }}/.github/scripts/build-tachometer-comment.js');
97+
const { commentOrUpdate } = await import('${{ github.workspace }}/.github/scripts/comment-or-update.js');
98+
const body = buildTachometerComment();
99+
commentOrUpdate(github, context, '## Tachometer results', body);

.github/workflows/coveralls.yml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
name: Coveralls Code Coverage
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
1010

1111
jobs:
12-
code-coverage-report:
13-
name: Generate and upload coverage report
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: Checkout PR branch
17-
uses: actions/checkout@v4
12+
code-coverage-report:
13+
name: Generate and upload coverage report
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout PR branch
17+
uses: actions/checkout@v4
1818

19-
- name: Setup Job and Install Dependencies
20-
uses: ./.github/actions/setup-job
19+
- name: Setup Job and Install Dependencies
20+
uses: ./.github/actions/setup-job
2121

22-
- name: Install Playwright
23-
run: yarn playwright install --with-deps
22+
- name: Install Playwright
23+
run: cd 1st-gen && yarn playwright install --with-deps
2424

25-
- name: Run unit tests with coverage
26-
run: yarn test:ci --config web-test-runner.config.ci-chromium.js --group unit --coverage
27-
continue-on-error: true
25+
- name: Run unit tests with coverage
26+
run: cd 1st-gen && yarn test:ci --config web-test-runner.config.ci-chromium.js --group coveralls-ci --coverage
27+
continue-on-error: true
2828

29-
- name: Upload coverage to Coveralls
30-
uses: coverallsapp/github-action@v2
31-
with:
32-
allow-empty: true
29+
- name: Upload coverage to Coveralls
30+
uses: coverallsapp/github-action@v2
31+
with:
32+
allow-empty: true

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
run: yarn install --immutable
104104

105105
- name: Lint styles
106-
if: ${{ needs.changed_files.outputs.styles_added_files != '' || needs.changed_files.outputs.styles_modified_files != '' }}
106+
# if: ${{ needs.changed_files.outputs.styles_added_files != '' || needs.changed_files.outputs.styles_modified_files != '' }}
107107
uses: reviewdog/action-stylelint@v1.30.2
108108
with:
109109
fail_level: error
@@ -116,10 +116,10 @@ jobs:
116116

117117
- name: ESLint
118118
uses: reviewdog/action-eslint@v1.33.2
119-
if: ${{ needs.changed_files.outputs.eslint_added_files != '' || needs.changed_files.outputs.eslint_modified_files != '' }}
119+
# if: ${{ needs.changed_files.outputs.eslint_added_files != '' || needs.changed_files.outputs.eslint_modified_files != '' }}
120120
with:
121121
fail_level: error
122122
level: error
123123
reporter: github-pr-review
124124
filter_mode: diff_context
125-
eslint_flags: '${{ needs.changed_files.outputs.eslint_added_files }} ${{ needs.changed_files.outputs.eslint_modified_files }}'
125+
eslint_flags: '--config .eslintrc.json ${{ needs.changed_files.outputs.eslint_added_files }} ${{ needs.changed_files.outputs.eslint_modified_files }}'

0 commit comments

Comments
 (0)