Skip to content

Commit d48544a

Browse files
authored
Common workflow and self test infrastructure
1 parent 28d535e commit d48544a

27 files changed

+14042
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'bug'
6+
assignees:
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
16+
**Expected behavior**
17+
A clear and concise description of what you expected to happen.
18+
19+
**Environment (please complete the following information):**
20+
21+
- [tool or library]
22+
- Version [e.g. v0.0.3]
23+
- OS: [e.g. windows/linux/darwin]
24+
25+
**Additional context**
26+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: "For feature requests. Please search for existing issues first. Also see CONTRIBUTING."
4+
title: ''
5+
labels: 'enhancement'
6+
assignees:
7+
8+
---
9+
10+
**Describe The Problem To Be Solved**
11+
Please present a concise description of the problem to be addressed by this feature request. Please be clear what parts of the problem are considered to be in-scope and out-of-scope.
12+
13+
**(Optional): Suggest A Solution**
14+
A concise description of your preferred solution. Things to address include:
15+
16+
* Details of the technical implementation
17+
* Tradeoffs made in design decisions
18+
* Caveats and considerations for the future
19+
20+
If there are multiple solutions, please present each one separately. Save comparisons for the very end.

.github/WORKFLOWS.md

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
# Build and Verify Workflow Usage
2+
3+
This document explains how to use the `build-and-verify.yml` reusable workflow for cross-platform
4+
TypeScript VS Code extension builds with comprehensive CI/CD features.
5+
6+
## Required Platform Matrix File
7+
8+
The workflow **requires** a platform matrix file to be provided. There is no default matrix, ensuring
9+
that each caller explicitly defines their target platforms. This approach provides better control
10+
and prevents unexpected platform builds.
11+
12+
### Platform Matrix File Format
13+
14+
Create a JSON file in your repository with the following format:
15+
16+
```json
17+
[
18+
{
19+
"platform": "windows-2022",
20+
"arch": "amd64"
21+
},
22+
{
23+
"platform": "ubuntu-24.04",
24+
"arch": "amd64"
25+
},
26+
{
27+
"platform": "macos-14",
28+
"arch": "arm64"
29+
}
30+
]
31+
```
32+
33+
## Usage Examples
34+
35+
### Basic Usage
36+
37+
```yaml
38+
jobs:
39+
build-and-test:
40+
uses: Open-CMSIS-Pack/vscode-extension-workflows/.github/workflows/build-and-verify.yml@main
41+
with:
42+
platform-matrix-file: '.github/platform-matrix.json'
43+
```
44+
45+
### Advanced Usage
46+
47+
```yaml
48+
name: Advanced CI/CD Pipeline
49+
50+
on:
51+
push:
52+
branches: [ main, develop ]
53+
pull_request:
54+
branches: [ main ]
55+
56+
jobs:
57+
build-and-test:
58+
permissions:
59+
contents: write # Required for release version bumps
60+
uses: Open-CMSIS-Pack/vscode-extension-workflows/.github/workflows/build-and-verify.yml@main
61+
with:
62+
platform-matrix-file: 'config/platforms.json'
63+
package-manager: 'yarn'
64+
working-directory: './app'
65+
build-command: 'build:prod'
66+
test-command: 'test:ci'
67+
lint-command: 'lint:check'
68+
enable-qlty: true
69+
secrets:
70+
QLTY_COVERAGE_TOKEN: ${{ secrets.QLTY_COVERAGE_TOKEN }}
71+
PR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
```
73+
74+
### Platform-Specific Configurations
75+
76+
#### Minimal (Single Platform)
77+
78+
```json
79+
[
80+
{
81+
"platform": "ubuntu-24.04",
82+
"arch": "amd64"
83+
}
84+
]
85+
```
86+
87+
#### Cross-Platform (Current Default)
88+
89+
This is the current configuration used by this repository:
90+
91+
```json
92+
[
93+
{
94+
"platform": "windows-2022",
95+
"arch": "amd64"
96+
},
97+
{
98+
"platform": "ubuntu-24.04",
99+
"arch": "amd64"
100+
},
101+
{
102+
"platform": "macos-14",
103+
"arch": "arm64"
104+
}
105+
]
106+
```
107+
108+
#### Comprehensive (All Platforms & Architectures)
109+
110+
```json
111+
[
112+
{
113+
"platform": "ubuntu-22.04",
114+
"arch": "amd64"
115+
},
116+
{
117+
"platform": "ubuntu-24.04",
118+
"arch": "amd64"
119+
},
120+
{
121+
"platform": "ubuntu-24.04",
122+
"arch": "arm64"
123+
},
124+
{
125+
"platform": "windows-2022",
126+
"arch": "amd64"
127+
},
128+
{
129+
"platform": "windows-2022",
130+
"arch": "arm64"
131+
},
132+
{
133+
"platform": "macos-13",
134+
"arch": "amd64"
135+
},
136+
{
137+
"platform": "macos-14",
138+
"arch": "arm64"
139+
},
140+
{
141+
"platform": "macos-15",
142+
"arch": "arm64"
143+
}
144+
]
145+
```
146+
147+
## Required Inputs
148+
149+
| Input | Required | Description |
150+
|-------|----------|-------------|
151+
| `platform-matrix-file` || Path to JSON file containing platform matrix |
152+
153+
## Optional Inputs
154+
155+
| Input | Default | Description |
156+
|-------|---------|-------------|
157+
| `node-version-file` | `./package.json` | Path to package.json file for Node.js version detection |
158+
| `package-manager` | `npm` | Package manager to use (npm or yarn) with auto-detection |
159+
| `working-directory` | `.` | Working directory for the build |
160+
| `build-command` | `build` | npm/yarn script name for building |
161+
| `test-command` | `test` | npm/yarn script name for testing |
162+
| `lint-command` | `lint` | npm/yarn script name for linting |
163+
| `enable-qlty` | `false` | Enable Qlty coverage upload (requires QLTY_COVERAGE_TOKEN) |
164+
165+
## Secrets
166+
167+
| Secret | Required | Description |
168+
|--------|----------|-------------|
169+
| `QLTY_COVERAGE_TOKEN` | Optional | Required only if `enable-qlty: true` |
170+
| `PR_TOKEN` | Optional | Required only for release workflows to create version bump PRs |

.github/dependabot.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
version: 2
2+
3+
updates:
4+
# Maintain dependencies for the JavaScript packages
5+
- package-ecosystem: "npm"
6+
directory: "/"
7+
open-pull-requests-limit: 10
8+
schedule:
9+
interval: "weekly"
10+
day: "sunday"
11+
ignore:
12+
- dependency-name: "@types/node"
13+
update-types:
14+
- version-update:semver-major
15+
- dependency-name: "jest"
16+
update-types:
17+
- version-update:semver-major
18+
- dependency-name: "@types/jest"
19+
update-types:
20+
- version-update:semver-major
21+
22+
# Maintain dependencies for GitHub Actions
23+
- package-ecosystem: "github-actions"
24+
directory: "/"
25+
schedule:
26+
interval: "weekly"
27+
day: "sunday"

.github/platform-matrix.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{
3+
"platform": "windows-2022",
4+
"arch": "amd64"
5+
},
6+
{
7+
"platform": "ubuntu-24.04",
8+
"arch": "amd64"
9+
},
10+
{
11+
"platform": "macos-14",
12+
"arch": "arm64"
13+
}
14+
]

.github/pull_request_template.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Fixes
2+
<!-- List the issue(s) this PR resolves -->
3+
-
4+
5+
## Changes
6+
<!-- List the changes this PR introduces -->
7+
-
8+
9+
## Checklist
10+
<!-- Put an `x` in the boxes. All tasks must be completed and boxes checked before merging. -->
11+
- [ ] 🤖 This change is covered by unit tests (if applicable).
12+
- [ ] 🤹 Manual testing has been performed (if necessary).
13+
- [ ] 🛡️ Security impacts have been considered (if relevant).
14+
- [ ] 📖 Documentation updates are complete (if required).
15+
- [ ] 🧠 Third-party dependencies and TPIP updated (if required).

0 commit comments

Comments
 (0)