Skip to content

Commit dca313b

Browse files
committed
Merge branch 'main' into bdougie/con-2329-add-a-cookie-banner-site
2 parents f3511d4 + 7eac665 commit dca313b

File tree

97 files changed

+2968
-1832
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+2968
-1832
lines changed
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
name: 'Build VS Code Extension'
2+
description: 'Build VS Code extension for a specific platform'
3+
inputs:
4+
platform:
5+
description: 'Target platform (win32, linux, alpine, darwin)'
6+
required: true
7+
arch:
8+
description: 'Target architecture (x64, arm64, armhf)'
9+
required: true
10+
npm_config_arch:
11+
description: 'npm config arch (x64, arm64, arm)'
12+
required: true
13+
pre-release:
14+
description: 'Whether to build as pre-release'
15+
required: false
16+
default: 'false'
17+
commit-sha:
18+
description: 'Commit SHA for version modification (optional, uses first 7 chars)'
19+
required: false
20+
default: ''
21+
outputs:
22+
target:
23+
description: 'The target string used for the build'
24+
value: ${{ steps.set-target.outputs.target }}
25+
vsix-path:
26+
description: 'Path to the generated VSIX file'
27+
value: 'extensions/vscode/*.vsix'
28+
build-path:
29+
description: 'Path to the build artifacts'
30+
value: 'extensions/vscode/build'
31+
32+
runs:
33+
using: 'composite'
34+
steps:
35+
- uses: actions/setup-node@v4
36+
with:
37+
node-version-file: ".nvmrc"
38+
39+
- name: Set target variable
40+
id: set-target
41+
shell: bash
42+
run: echo "target=${{ inputs.platform }}-${{ inputs.arch }}" >> $GITHUB_OUTPUT
43+
44+
- name: Cache npm
45+
uses: actions/cache@v4
46+
with:
47+
path: ~/.npm
48+
key: ${{ runner.os }}-npm-cache-build-${{ hashFiles('**/package-lock.json') }}
49+
50+
- name: Cache extension node_modules
51+
uses: actions/cache@v4
52+
with:
53+
path: extensions/vscode/node_modules
54+
key: ${{ runner.os }}-node-${{ hashFiles('extensions/vscode/package-lock.json') }}
55+
56+
- name: Cache core node_modules
57+
uses: actions/cache@v4
58+
with:
59+
path: core/node_modules
60+
key: ${{ runner.os }}-node-${{ hashFiles('core/package-lock.json') }}
61+
62+
- name: Cache gui node_modules
63+
uses: actions/cache@v4
64+
with:
65+
path: gui/node_modules
66+
key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }}
67+
68+
- name: Cache packages node_modules
69+
uses: actions/cache@v4
70+
with:
71+
path: |
72+
packages/*/node_modules
73+
key: ${{ runner.os }}-packages-node-modules-${{ hashFiles('packages/*/package-lock.json') }}
74+
75+
- name: Build packages
76+
shell: bash
77+
run: node ./scripts/build-packages.js
78+
79+
- name: Install extension dependencies
80+
shell: bash
81+
run: |
82+
cd extensions/vscode
83+
npm ci
84+
env:
85+
# https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333
86+
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
87+
88+
- name: Install gui dependencies
89+
shell: bash
90+
run: |
91+
cd gui
92+
npm ci
93+
94+
- name: Install core dependencies
95+
shell: bash
96+
run: |
97+
cd core
98+
npm ci
99+
npm i vectordb
100+
101+
- name: Prepackage the extension
102+
shell: bash
103+
run: |
104+
cd extensions/vscode
105+
npm run prepackage -- --target ${{ steps.set-target.outputs.target }}
106+
107+
- name: Re-install esbuild
108+
shell: bash
109+
run: |
110+
cd extensions/vscode
111+
npm install -f esbuild
112+
113+
- name: Modify package.json version with commit SHA
114+
if: inputs.commit-sha != ''
115+
shell: bash
116+
run: |
117+
cd extensions/vscode
118+
# Get current version from package.json
119+
CURRENT_VERSION=$(node -p "require('./package.json').version")
120+
121+
# Create new version with short commit SHA (first 7 chars)
122+
COMMIT_SHORT="${{ inputs.commit-sha }}"
123+
NEW_VERSION="${CURRENT_VERSION}-${COMMIT_SHORT:0:7}"
124+
125+
echo "📝 Updating package.json version from $CURRENT_VERSION to $NEW_VERSION"
126+
127+
# Update version in package.json
128+
sed -i.bak "s/\"version\": \"$CURRENT_VERSION\"/\"version\": \"$NEW_VERSION\"/" package.json
129+
130+
# Remove backup file
131+
rm -f package.json.bak
132+
133+
# Verify the change
134+
echo "✅ New version: $(node -p "require('./package.json').version")"
135+
136+
- name: Package extension (build artifacts)
137+
shell: bash
138+
run: |
139+
cd extensions/vscode
140+
npm run package
141+
142+
- name: Package extension (.vsix files)
143+
shell: bash
144+
run: |
145+
cd extensions/vscode
146+
if [ "${{ inputs.pre-release }}" = "true" ]; then
147+
npx vsce package --pre-release --no-dependencies --target ${{ steps.set-target.outputs.target }}
148+
else
149+
npx vsce package --no-dependencies --target ${{ steps.set-target.outputs.target }}
150+
fi
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: 'Run JetBrains Tests'
2+
description: 'Setup and run JetBrains IntelliJ tests with all dependencies'
3+
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- uses: actions/setup-node@v4
8+
with:
9+
node-version-file: ".nvmrc"
10+
11+
- uses: actions/cache@v4
12+
with:
13+
path: core/node_modules
14+
key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }}
15+
16+
- name: Build packages and install core dependencies
17+
shell: bash
18+
run: |
19+
node ./scripts/build-packages.js
20+
cd core
21+
npm ci
22+
23+
- name: Setup Java
24+
uses: actions/[email protected]
25+
with:
26+
distribution: zulu
27+
java-version: 17
28+
29+
- name: Setup FFmpeg
30+
uses: AnimMouse/setup-ffmpeg@v1
31+
with:
32+
token: ${{ env.GITHUB_TOKEN }}
33+
34+
- name: Setup Gradle
35+
uses: gradle/actions/setup-gradle@v3
36+
37+
- uses: actions/cache@v4
38+
with:
39+
path: ~/.npm
40+
key: ${{ runner.os }}-npm-cache-jetbrains-${{ hashFiles('extensions/vscode/package-lock.json') }}
41+
42+
- uses: actions/cache@v4
43+
id: vscode-extension-cache
44+
with:
45+
path: extensions/vscode/node_modules
46+
key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }}
47+
48+
- uses: actions/cache@v4
49+
id: gui-cache
50+
with:
51+
path: gui/node_modules
52+
key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }}
53+
54+
# Cache prepackaged extension build to share with other jobs
55+
- uses: actions/cache@v4
56+
id: vscode-prepackage-cache
57+
with:
58+
path: extensions/vscode/build
59+
key: ${{ runner.os }}-vscode-prepackage-${{ hashFiles('extensions/vscode/package-lock.json', 'extensions/vscode/**/*.ts', 'extensions/vscode/**/*.json') }}
60+
61+
# Only run prepackage if not cached - saves ~1 minute
62+
- name: Run prepackage script
63+
if: steps.vscode-prepackage-cache.outputs.cache-hit != 'true'
64+
shell: bash
65+
run: |
66+
cd extensions/vscode
67+
if [ "${{ steps.vscode-extension-cache.outputs.cache-hit }}" != "true" ]; then
68+
npm ci
69+
fi
70+
npm run prepackage
71+
env:
72+
# https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333
73+
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
74+
75+
- uses: actions/cache@v4
76+
id: binary-cache
77+
with:
78+
path: binary/node_modules
79+
key: ${{ runner.os }}-binary-node-modules-${{ hashFiles('binary/package-lock.json') }}
80+
81+
- name: Build the binaries
82+
shell: bash
83+
run: |
84+
cd binary
85+
npm run build
86+
87+
- name: Start test IDE
88+
shell: bash
89+
run: |
90+
cd extensions/intellij
91+
export DISPLAY=:99.0
92+
Xvfb -ac :99 -screen 0 1920x1080x24 &
93+
sleep 10
94+
mkdir -p build/reports
95+
./gradlew runIdeForUiTests &
96+
97+
- name: Wait for JB connection
98+
uses: jtalk/url-health-check-action@v3
99+
with:
100+
url: http://127.0.0.1:8082
101+
max-attempts: 15
102+
retry-delay: 30s
103+
104+
- name: Run tests
105+
shell: bash
106+
run: |
107+
cd extensions/intellij
108+
export DISPLAY=:99.0
109+
./gradlew test
110+
111+
- name: Move video
112+
if: ${{ failure() }}
113+
shell: bash
114+
run: |
115+
cd extensions/intellij
116+
mv video build/reports
117+
118+
- name: Copy logs
119+
if: ${{ failure() }}
120+
shell: bash
121+
run: |
122+
cd extensions/intellij
123+
mv build/idea-sandbox/system/log/ build/reports
124+
125+
- name: Save fails report
126+
if: ${{ failure() }}
127+
uses: actions/upload-artifact@v4
128+
with:
129+
name: jb-failure-report
130+
path: |
131+
${{ github.workspace }}/extensions/intellij/build/reports

0 commit comments

Comments
 (0)