Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,73 @@ jobs:
- name: Publish to npm
run: |
pnpm -r publish --tag ${{ github.event.inputs.npm_tag }} --publish-branch ${{ github.event.inputs.branch }}

release_vscode_extension:
name: Release VS Code Extension (${{ matrix.vsce-target }})
if: github.repository == 'web-infra-dev/rstest' && github.event_name == 'workflow_dispatch'
needs: release
runs-on: ${{ matrix.runner }}
environment: vscode-marketplace
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-latest
vsce-target: linux-x64
platform: linux
arch: x64
- runner: ubuntu-22.04-arm64
vsce-target: linux-arm64
platform: linux
arch: arm64
- runner: macos-13
vsce-target: darwin-x64
platform: darwin
arch: x64
- runner: macos-14
vsce-target: darwin-arm64
platform: darwin
arch: arm64
- runner: windows-2022
vsce-target: win32-x64
platform: win32
arch: x64
- runner: windows-latest
vsce-target: win32-arm64
platform: win32
arch: arm64
defaults:
run:
shell: bash
env:
npm_config_arch: ${{ matrix.arch }}
npm_config_platform: ${{ matrix.platform }}
VSCE_TARGET: ${{ matrix.vsce-target }}
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
fetch-depth: 1
ref: ${{ github.event.inputs.branch }}

- name: Setup Pnpm
run: |
npm install -g corepack@latest --force
corepack enable

- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
cache: 'pnpm'

- name: Install Dependencies
run: pnpm install

- name: Package VS Code Extension
run: pnpm --filter ./packages/vscode run package:vsce -o "rstest-${{ matrix.vsce-target }}.vsix"

- name: Publish VS Code Extension
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: pnpm --filter ./packages/vscode exec vsce publish --target ${{ matrix.vsce-target }}
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,7 @@ jobs:
- name: E2E Test
if: steps.changes.outputs.changed == 'true'
run: pnpm run e2e

- name: VS Code Extension Test
if: steps.changes.outputs.changed == 'true'
run: pnpm run test:vscode
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ test-temp-*
.vscode/**/*
!.vscode/settings.json
!.vscode/extensions.json
!.vscode/launch.json
!.vscode/tasks.json
.idea/
.nx/
.history/
Expand All @@ -34,5 +36,7 @@ test-results/
fixtures-test/
fixtures-test-*/
.rslib/

!packages/core/src/coverage
tests-dist/
.vscode-test/
packages/vscode/*.vsix
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/packages/vscode",
"${workspaceFolder}/packages/vscode/sample"
],
"outFiles": ["${workspaceFolder}/packages/vscode/dist/**/*.js"],
"preLaunchTask": "npm: build:local"
}
]
}
21 changes: 21 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "build:local",
"path": "packages/vscode",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
10 changes: 8 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.2.0/schema.json",
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
"assist": { "actions": { "source": { "organizeImports": "on" } } },
"vcs": {
"enabled": true,
Expand All @@ -9,7 +9,13 @@
},
"files": {
"ignoreUnknown": true,
"includes": ["**", "!**/*.vue", "!**/dist", "!**/dist-types"]
"includes": [
"**",
"!**/*.vue",
"!**/dist",
"!**/dist-types",
"!**/.vscode-test.mjs"
]
},
"formatter": {
"indentStyle": "space"
Expand Down
1 change: 0 additions & 1 deletion e2e/scripts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class Cli {
public stdout = '';
public stderr = '';
private stdoutListeners: Array<() => void> = [];
// biome-ignore lint/correctness/noUnusedPrivateClassMembers: will use it
private stderrListeners: Array<() => void> = [];

constructor(
Expand Down
2 changes: 1 addition & 1 deletion e2e/test-coverage/fixtures/src/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ export const countWords = (str: string): number => {

export const truncate = (str: string, maxLength: number): string => {
if (str.length <= maxLength) return str;
return str.slice(0, maxLength - 3) + '...';
return `${str.slice(0, maxLength - 3)}...`;
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"scripts": {
"typecheck": "cross-env NX_DAEMON=false nx run-many -t typecheck --exclude @examples/* --parallel=10",
"build": "cross-env NX_DAEMON=false nx run-many -t build --exclude @examples/* @rstest/tests-* --parallel=10",
"test:vscode": "pnpm --filter ./packages/vscode test",
"e2e": "cd e2e && pnpm test",
"test": "rstest",
"change": "changeset",
Expand Down
Loading
Loading