Repository navigation
162 lines (158 loc) · 7.73 KB
/
Copy pathextension.yml
File metadata and controls
162 lines (158 loc) · 7.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: VS Code extension packages
on:
workflow_call:
workflow_dispatch:
inputs:
native_target:
description: All platforms or an isolated Intel Mac recheck
type: choice
options: [all, darwin-x64]
default: all
pull_request:
paths:
- extension/**
- tauri/src-tauri/**
- .github/workflows/extension.yml
concurrency:
group: extension-packages-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
native:
name: ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(inputs.native_target == 'darwin-x64' && '[{"os":"macos-26-intel","target":"darwin-x64","vscode":"darwin"}]' || '[{"os":"ubuntu-22.04","target":"linux-x64","vscode":"linux-x64"},{"os":"macos-26","target":"darwin-arm64","vscode":"darwin-arm64"},{"os":"macos-26-intel","target":"darwin-x64","vscode":"darwin"}]') }}
runs-on: ${{ matrix.os }}
timeout-minutes: 40
env:
MACOSX_DEPLOYMENT_TARGET: '26.0'
defaults:
run:
working-directory: extension
shell: bash
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
cache: npm
cache-dependency-path: |
extension/package-lock.json
tauri/package-lock.json
- uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
with:
workspaces: tauri/src-tauri
cache-on-failure: true
- name: Install Linux native dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-layer-shell-dev libappindicator3-dev librsvg2-dev patchelf xvfb gnome-keyring dbus-x11
- name: Start an unlocked disposable Linux credential store
if: runner.os == 'Linux'
run: |
export XDG_DATA_HOME="$RUNNER_TEMP/fixture-keyring-data"
mkdir -p "$XDG_DATA_HOME"
chmod 700 "$XDG_DATA_HOME"
export DBUS_SESSION_BUS_ADDRESS
DBUS_SESSION_BUS_ADDRESS=$(dbus-daemon --session --fork --print-address)
printf '%s' 'multi-codex-synthetic-ci-keyring' | gnome-keyring-daemon --unlock --components=secrets
echo "DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS" >> "$GITHUB_ENV"
echo "XDG_DATA_HOME=$XDG_DATA_HOME" >> "$GITHUB_ENV"
- name: Build the native account helper
run: |
npm ci --prefix ../tauri
npm --prefix ../tauri run build
npm ci
npm run build:helper
npm run build
- name: Install pinned official VS Code and Codex into disposable directories
env:
VSCODE_PLATFORM: ${{ matrix.vscode }}
run: |
curl --fail --location --retry 3 --max-time 300 "https://update.code.visualstudio.com/1.140.0/$VSCODE_PLATFORM/stable" -o "$RUNNER_TEMP/vscode.archive"
mkdir "$RUNNER_TEMP/vscode" "$RUNNER_TEMP/codex-extensions"
if [[ "$RUNNER_OS" == 'macOS' ]]; then
ditto -xk "$RUNNER_TEMP/vscode.archive" "$RUNNER_TEMP/vscode"
code_executable=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$RUNNER_TEMP/vscode/Visual Studio Code.app/Contents/Info.plist")
code_binary="$RUNNER_TEMP/vscode/Visual Studio Code.app/Contents/MacOS/$code_executable"
code_cli="$RUNNER_TEMP/vscode/Visual Studio Code.app/Contents/Resources/app/bin/code"
else
tar -xzf "$RUNNER_TEMP/vscode.archive" -C "$RUNNER_TEMP/vscode" --strip-components=1
code_binary="$RUNNER_TEMP/vscode/code"
code_cli="$RUNNER_TEMP/vscode/bin/code"
fi
test -x "$code_binary"
for attempt in 1 2 3; do
if "$code_cli" --user-data-dir "$RUNNER_TEMP/install-profile" --extensions-dir "$RUNNER_TEMP/codex-extensions" --install-extension openai.chatgpt@26.1002.51308 --force; then break; fi
if [[ "$attempt" == 3 ]]; then exit 1; fi
sleep 5
done
codex_extension=$(find "$RUNNER_TEMP/codex-extensions" -maxdepth 1 -type d -name 'openai.chatgpt-*' -print -quit)
test -n "$codex_extension"
export codex_extension
codex_engine=$(node --input-type=module -e 'import { createRequire } from "node:module"; const { bundledEnginePath } = createRequire(import.meta.url)("./dist/core.cjs"); console.log(await bundledEnginePath(process.env.codex_extension));')
test -x "$codex_engine"
"$codex_engine" --version
echo "MULTI_CODEX_TEST_VSCODE=$code_binary" >> "$GITHUB_ENV"
echo "MULTI_CODEX_TEST_EXTENSION=$codex_extension" >> "$GITHUB_ENV"
echo "MULTI_CODEX_TEST_ENGINE=$codex_engine" >> "$GITHUB_ENV"
- name: Test protocol, activity guards, rollback and native account storage
timeout-minutes: 5
run: npm test
- name: Verify native macOS Keychain access
if: runner.os == 'macOS'
run: cargo test --manifest-path ../tauri/src-tauri/Cargo.toml macos_live_keychain_round_trip -- --ignored --test-threads=1
- name: Package the platform-specific pre-release
env:
PACKAGE_TARGET: ${{ matrix.target }}
run: |
npm run package:platform -- "$PACKAGE_TARGET"
package_version=$(node -p "require('./package.json').version")
echo "PACKAGE_VERSION=$package_version" >> "$GITHUB_ENV"
mkdir "$RUNNER_TEMP/packaged-extension"
unzip -q "multi-codex-$PACKAGE_TARGET-$package_version.vsix" -d "$RUNNER_TEMP/packaged-extension"
test -x "$RUNNER_TEMP/packaged-extension/extension/bin/multi-codex-account-helper"
if [[ "$RUNNER_OS" == 'macOS' ]]; then
codesign --verify --strict "$RUNNER_TEMP/packaged-extension/extension/bin/multi-codex-account-helper"
otool -L "$RUNNER_TEMP/packaged-extension/extension/bin/multi-codex-account-helper"
fi
echo "MULTI_CODEX_TEST_DEVELOPMENT_PATH=$RUNNER_TEMP/packaged-extension/extension" >> "$GITHUB_ENV"
- name: Test packaged live attachment without reloading VS Code or Codex
run: |
if [[ "$RUNNER_OS" == 'Linux' ]]; then
xvfb-run -a env MULTI_CODEX_TEST_LIVE_ATTACH=1 node scripts/test-vscode.mjs
else
MULTI_CODEX_TEST_LIVE_ATTACH=1 node scripts/test-vscode.mjs
fi
cp .test-results/vscode-result.json .test-results/packaged-live-attachment.json
- name: Test packaged isolated startup and project account restoration
env:
MULTI_CODEX_TEST_ORBIT_UI: '1'
run: |
if [[ "$RUNNER_OS" == 'Linux' ]]; then
xvfb-run -a node scripts/test-vscode.mjs
else
node scripts/test-vscode.mjs
fi
cp .test-results/vscode-result.json .test-results/packaged-startup.json
- name: Check extension dependency advisories
run: npm audit --audit-level=low
- name: Upload tested installable package
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: extension-${{ matrix.target }}
path: extension/multi-codex-${{ matrix.target }}-${{ env.PACKAGE_VERSION }}.vsix
if-no-files-found: error
- name: Upload synthetic test evidence
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: extension-evidence-${{ matrix.target }}
path: extension/.test-results/
if-no-files-found: warn
include-hidden-files: true