Skip to content

Commit b87852e

Browse files
committed
chore: update workflows
1 parent 302c445 commit b87852e

27 files changed

+911
-665
lines changed

.changeset/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Changesets
2+
3+
This project uses [changesets](https://github.com/changesets/changesets) for version management and changelog generation.
4+
5+
## Adding a changeset
6+
7+
When you make a change that should be released, run:
8+
9+
```bash
10+
pnpm changeset
11+
```
12+
13+
This will prompt you to:
14+
1. Select which packages are affected
15+
2. Choose the bump type (patch/minor/major)
16+
3. Write a summary of the changes
17+
18+
## Lockstep versioning
19+
20+
All `@stencil/*` packages are configured for **lockstep versioning** - they will always have the same version number. When any package changes, all packages are bumped together.
21+
22+
## Release process
23+
24+
1. Changesets accumulate in `.changeset/` as PRs are merged
25+
2. When ready to release, run `pnpm changeset:version` to consume changesets and bump versions
26+
3. Review the generated CHANGELOG.md files
27+
4. Run `pnpm changeset:publish` to publish all packages

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [["@stencil/core", "@stencil/cli", "@stencil/dev-server", "@stencil/mock-doc"]],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "v5",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

.github/workflows/README.md

Lines changed: 54 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,79 @@
11
# Stencil Continuous Integration (CI)
22

3-
Continuous integration (CI) is an important aspect of any project, and is used to verify and validate the changes to the
4-
codebase work as intended, to avoid introducing regressions (bugs), and to adhere to coding standards (e.g. formatting
5-
rules). It provides a consistent means of performing a series of checks over the entire codebase on behalf of the team.
6-
7-
This document explains Stencil's CI setup.
3+
This document explains Stencil's CI setup for the v5 monorepo.
84

95
## CI Environment
106

11-
Stencil's CI system runs on GitHub Actions.
12-
GitHub Actions allow developers to declare a series of _workflows_ to run following an _event_ in the repository, or on
13-
a set schedule.
14-
15-
The workflows that are run as a part of Stencil's CI process are declared as YAML files, and are stored in the same
16-
directory as this file.
17-
Each workflow file is explained in greater depth in the [workflows section](#workflows) of this document.
7+
Stencil's CI runs on GitHub Actions using pnpm and supports Node.js 22 and 24.
188

19-
## Workflows
9+
## Workflow Structure
2010

21-
This section describes each of Stencil's GitHub Actions workflows.
22-
Each of these tasks below are codified as [reusable workflows](https://docs.github.com/en/actions/using-workflows/reusing-workflows).
11+
```mermaid
12+
graph TD;
13+
quality[Quality]
14+
build[Build]
15+
unit[Unit Tests]
16+
17+
quality --> |parallel| build
18+
build --> unit
19+
20+
unit --> test-build[Build Tests]
21+
unit --> test-integration[Integration Tests]
22+
unit --> test-runtime[Runtime Tests]
23+
unit --> test-special-config[Special Config Tests]
24+
unit --> test-ssr[SSR Tests]
25+
unit --> test-starter[Component Starter]
26+
```
2327

24-
Generally speaking, workflows are designed to be declarative in nature.
25-
As such, this section does not intend to duplicate the details of each workflow, but rather give a high level overview
26-
of each one and mention nuances of each.
28+
## Workflows
2729

2830
### Main (`main.yml`)
2931

30-
The main workflow for Stencil can be found in `main.yml` in this directory.
31-
This workflow is the entrypoint of Stencil's CI system, and initializes every workflow & job that runs.
32-
33-
### Build (`build.yml`)
34-
35-
This workflow is responsible for building Stencil and validating the resultant artifact.
36-
37-
### Format (`format.yml`)
38-
39-
This workflow is responsible for validating that the code adheres to the Stencil team's formatting configuration before
40-
a pull request is merged.
41-
42-
### Dev Release (`release-dev.yml`)
43-
44-
This workflow initiates a developer build of Stencil from the `main` branch.
45-
It is intended to be manually invoked by a member of the Stencil team.
46-
47-
### Nightly Release (`release-nightly.yml`)
48-
49-
This workflow initiates a nightly build of Stencil from the `main` branch.
50-
A nightly build is similar to a 'Dev Release', except that:
51-
- it is run on a set cadence (it is not expectedthat a developer to manually invoke it)
52-
- it is published to the npm registry under the 'nightly' tag
32+
The orchestrator workflow that runs on push to `main`/`v5` branches and on pull requests.
5333

54-
### Test Analysis (`test-analysis.yml`)
34+
### Quality (`quality.yml`)
5535

56-
This workflow is responsible for running the Stencil analysis testing suite.
36+
Runs quality checks (Linux only):
37+
- `pnpm format:check` - Code formatting (oxfmt)
38+
- `pnpm lint:check` - Linting (oxlint)
39+
- `pnpm typecheck` - TypeScript type checking
40+
- `pnpm knip` - Unused code detection
5741

58-
### Test End-to-End (`test-e2e.yml`)
59-
60-
This workflow is responsible for running the Stencil end-to-end testing suite.
61-
This suite does _not_ run Stencil's BrowserStack tests.
62-
Those are handled by a [separate workflow](#browserstack-browserstackyml).
63-
64-
### Test Unit (`test-unit.yml`)
65-
66-
This workflow is responsible for running the Stencil unit testing suite.
67-
68-
### WebdriverIO Tests (`test-wdio.yml`)
69-
70-
This workflow runs our integration tests which assert that various Stencil
71-
features work correctly when components using them are built and then rendered
72-
in actual browsers. We run these tests using
73-
[WebdriverIO](https://webdriver.io/) against Firefox, Chrome, and Edge.
74-
75-
For more information on how those tests are set up please see the [WebdriverIO
76-
test README](../../test/wdio/README.md).
77-
78-
### Design
79-
80-
#### Overview
42+
### Build (`build.yml`)
8143

82-
Most of the workflows above are contingent on the build finishing (otherwise there would be nothing to run against).
83-
The diagram below displays the dependencies between each workflow.
44+
Builds all packages and uploads artifacts for downstream jobs.
8445

85-
```mermaid
86-
graph LR;
87-
build-core-->test-analysis;
88-
build-core-->test-e2e;
89-
build-core-->test-unit;
90-
format;
91-
```
46+
### Test Workflows
9247

93-
Making each 'task' a reusable workflow allows CI to run more jobs in parallel, improving the throughput of Stencil's CI.
94-
All resusable workflows can be found in the [workflows directory](.).
95-
This is a GitHub Actions convention that cannot be overridden.
48+
All test workflows run on a matrix of:
49+
- **OS**: Ubuntu, Windows
50+
- **Node**: 22, 24
9651

97-
#### Running Tests
52+
| Workflow | Description |
53+
|----------|-------------|
54+
| `test-unit.yml` | Unit tests for packages (`pnpm test`) |
55+
| `test-build.yml` | Build test suite (`test/build`) |
56+
| `test-integration.yml` | Integration tests (`test/integration`) |
57+
| `test-runtime.yml` | Runtime tests (`test/runtime`) |
58+
| `test-special-config.yml` | Special config tests (`test/special-config`) |
59+
| `test-ssr.yml` | SSR tests (`test/ssr`) |
60+
| `test-component-starter.yml` | Smoke test with component starter template |
9861

99-
All test-related jobs require the build to finish first.
100-
Upon successful completion of the build workflow, each test workflow will start.
62+
## Release Workflows
10163

102-
The test-running workflows have been designed to run in parallel and are configured to run against several operating
103-
systems & versions of node.
104-
For a test workflow that theoretically runs on Ubuntu and Windows operating systems and targets Node v14, v16 and v18, a
105-
single test workflow may spawn several jobs:
106-
107-
```mermaid
108-
graph LR;
109-
test-analysis-->ubuntu-node14;
110-
test-analysis-->ubuntu-node16;
111-
test-analysis-->ubuntu-node18;
112-
test-analysis-->windows-node14;
113-
test-analysis-->windows-node16;
114-
test-analysis-->windows-node18;
115-
```
64+
Release workflows are managed separately and support both v4 (legacy) and v5 (monorepo with changesets).
11665

117-
These 'os-node jobs' (e.g. `ubuntu-node16`) are designed to _not_ prematurely stop their sibling jobs should one of
118-
them fail.
119-
This allows the opportunity for the sibling test jobs to potentially pass, and reduce the number of runners that need to
120-
be spun up again should a developer wish to 're-run failed jobs'.
121-
Should a developer feel that it is more appropriate to re-run all os-node jobs, they may do so using GitHub's 're-run
122-
all jobs' options in the GitHub Actions UI.
66+
| Workflow | Description |
67+
|----------|-------------|
68+
| `release-dev.yml` | Developer builds from main |
69+
| `release-nightly.yml` | Nightly builds |
70+
| `release-production.yml` | Production releases |
71+
| `publish-npm.yml` | NPM publishing |
12372

124-
#### Concurrency
73+
## Test Matrix
12574

126-
When a `git push` is made to a branch, Stencil's CI is designed to stop existing job(s) associated with the workflow +
127-
branch.
128-
A new CI run (of each workflow) will begin upon stopping the existing job(s) using the new `HEAD` of the branch.
75+
All test workflows use `fail-fast: false` so sibling jobs continue even if one fails. This reduces the need to re-run all jobs when investigating failures.
12976

130-
## Repository Configuration
77+
## Concurrency
13178

132-
Each of the workflows described in the [workflows section](#workflows) of this document must be configured in the
133-
Stencil GitHub repository to be _required_ to pass in order to land code in the `main` branch.
79+
When a `git push` is made to a branch, existing CI jobs for that branch are cancelled and a new run begins.

.github/workflows/actions/check-git-context/action.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/actions/download-archive/action.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
name: 'Get Core Dependencies'
2-
description: 'sets the node version & initializes core dependencies'
2+
description: 'Sets up pnpm, node version & installs dependencies'
33
runs:
44
using: composite
55
steps:
6-
# this overrides previous versions of the node runtime that was set.
7-
# jobs that need a different version of the Node runtime should explicitly
8-
# set their node version after running this step
6+
- name: Setup pnpm
7+
uses: pnpm/action-setup@v4
8+
99
- name: Use Node Version from Volta
10-
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
10+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
1111
with:
1212
node-version-file: './package.json'
13-
cache: 'npm'
13+
cache: 'pnpm'
1414

1515
- name: Install Dependencies
16-
run: |
17-
npm ci \
18-
&& npm run install.jest
19-
16+
run: pnpm install --frozen-lockfile
2017
shell: bash

.github/workflows/actions/upload-archive/action.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,30 @@
1-
name: Build Stencil
1+
name: Build
22

33
on:
44
workflow_call:
5-
# Make this a reusable workflow, no value needed
6-
# https://docs.github.com/en/actions/using-workflows/reusing-workflows
75

86
permissions:
97
contents: read
108

119
jobs:
12-
build_core:
13-
name: Core
14-
strategy:
15-
matrix:
16-
os: ['ubuntu-22.04', 'windows-latest']
17-
runs-on: ${{ matrix.os }}
10+
build:
11+
name: Build
12+
runs-on: ubuntu-latest
1813
steps:
1914
- name: Checkout Code
20-
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2116

2217
- name: Get Core Dependencies
2318
uses: ./.github/workflows/actions/get-core-dependencies
2419

25-
- name: Core Build
26-
run: npm run build -- --ci
27-
shell: bash
28-
29-
- name: Validate Build
30-
run: npm run test.dist
31-
shell: bash
32-
33-
- name: Validate Testing
34-
run: npm run test.testing
35-
shell: bash
20+
- name: Build
21+
run: pnpm build
3622

3723
- name: Upload Build Artifacts
38-
if: ${{ matrix.os == 'ubuntu-22.04' }}
39-
uses: ./.github/workflows/actions/upload-archive
24+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4025
with:
41-
name: stencil-core
42-
output: stencil-core-build.zip
43-
paths: cli compiler dev-server internal mock-doc scripts/build screenshot sys testing
26+
name: stencil-build
27+
path: |
28+
packages/*/dist/
29+
packages/*/bin/
30+
retention-days: 1

.github/workflows/lint-and-format.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)