Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
79bcc29
feat(ci): optimize ci and e2e workflows
mattKorwel Sep 16, 2025
b12b100
feat(ci): add workflow_dispatch trigger
mattKorwel Sep 16, 2025
9a6ec5c
fix(ci): resolve yaml syntax errors
mattKorwel Sep 16, 2025
eee7e38
feat(ci): Run tests in parallel with most lint jobs
mattKorwel Sep 16, 2025
7b374b3
fix(ci): Restrict bundle_size job to pull_request events
mattKorwel Sep 16, 2025
2173704
feat(ci): Add final 'CI' aggregator job
mattKorwel Sep 16, 2025
bc34056
refactor(ci): Remove redundant virtual test job
mattKorwel Sep 16, 2025
e481cba
fix(ci): Use correct runner for js build job
mattKorwel Sep 16, 2025
177cf82
feat(ci): Use self-hosted runners for all Linux jobs
mattKorwel Sep 16, 2025
f22d26f
feat(ci): Use self-hosted runner for Windows test matrix
mattKorwel Sep 16, 2025
674fa1d
feat(ci): Enable fail-fast for test matrix
mattKorwel Sep 16, 2025
3eb9f46
refactor(ci): Have coverage comment depend on final CI job
mattKorwel Sep 16, 2025
a69b6f6
refactor(ci): Make tests depend on all linters to fail faster
mattKorwel Sep 16, 2025
c0f3e74
fix(ci): Ensure coverage comment only posts on CI success
mattKorwel Sep 16, 2025
0f3dfc9
feat(ci): Use self-hosted runners for E2E workflow
mattKorwel Sep 16, 2025
4f96a1b
feat(ci): Add final 'E2E' aggregator job
mattKorwel Sep 16, 2025
37825cb
perf(ci): Increase parallelism for Vitest
mattKorwel Sep 16, 2025
9c079cd
chore: Add debug step to CI workflow
mattKorwel Sep 16, 2025
a2cc9e7
fix: Correct formatting and shellcheck installation in CI
mattKorwel Sep 16, 2025
87135ab
chore: Re-trigger CI
mattKorwel Sep 16, 2025
f5622bb
fix(ci): Correct various linting and formatting issues in CI workflow
mattKorwel Sep 16, 2025
203c248
fix(ci): Correct shellcheck download URL
mattKorwel Sep 16, 2025
3d9d882
fix(ci): Create directory for actionlint before extraction
mattKorwel Sep 16, 2025
675ae63
fix(ci): Pin actions to specific commit SHAs
mattKorwel Sep 16, 2025
4e14ddc
fix(ci): Pin download-artifact action in e2e workflow
mattKorwel Sep 16, 2025
bbdc71d
fix(ci): Ensure shellcheck problem matcher directory exists
mattKorwel Sep 16, 2025
3207c7f
feat(ci): auto-commit prettier fixes
mattKorwel Sep 16, 2025
860a3e9
feat(ci): auto-fix prettier and lint issues
mattKorwel Sep 16, 2025
5627161
fix(ci): remove trailing space
mattKorwel Sep 16, 2025
b2e4122
fix(ci): remove unsupported vitest thread options
mattKorwel Sep 16, 2025
0dcc020
feat(ci): configure vitest multithreading
mattKorwel Sep 16, 2025
cac00ad
fix(ci): run npm ci in e2e tests
mattKorwel Sep 16, 2025
9bde018
fix(ci): Preserve file permissions in e2e artifacts
mattKorwel Sep 16, 2025
f4bf59f
feat(ci): Parallelize build and test jobs
mattKorwel Sep 16, 2025
23f08f0
feat(ci): make windows and macos tests non-blocking
mattKorwel Sep 16, 2025
4850c14
fix(ci): remove duplicate test_matrix job
mattKorwel Sep 16, 2025
ba2249d
fix(ci): correct job definition order
mattKorwel Sep 16, 2025
d76fa3d
fix(ci): resolve various linting and permission errors
mattKorwel Sep 16, 2025
9ccbac1
fix(ci): add missing newline at end of file
mattKorwel Sep 16, 2025
e160348
fix(ci): resolve actionlint and shellcheck errors
mattKorwel Sep 16, 2025
f030d3d
fix(ci): correct actionlint format string
mattKorwel Sep 16, 2025
76f793e
fix(ci): correct actionlint format string
mattKorwel Sep 16, 2025
f5be2da
try and fix action lint
mattKorwel Sep 16, 2025
ef042b3
newline
mattKorwel Sep 16, 2025
dde6771
fix(ci): resolve all outstanding linting and permission errors
mattKorwel Sep 16, 2025
b42c9ef
fix(ci): resolve all outstanding linting and permission errors
mattKorwel Sep 16, 2025
8c28714
fix(ci): resolve all outstanding linting and permission errors
mattKorwel Sep 16, 2025
7c43e92
fix(ci): correct permissions and prevent pushing to .github
mattKorwel Sep 16, 2025
74545cd
fix(ci): correct permissions and prevent pushing to .github
mattKorwel Sep 16, 2025
410907d
formatting
mattKorwel Sep 16, 2025
359691c
refactor(ci): consolidate linting into a single job
mattKorwel Sep 16, 2025
d7aea09
fix(ci): remove package matrix from test jobs
mattKorwel Sep 16, 2025
5dbcc06
formatting
mattKorwel Sep 16, 2025
278a306
chore(ci): remove code coverage step
mattKorwel Sep 16, 2025
13e4d0f
fix(ci): disable coverage generation in test jobs
mattKorwel Sep 16, 2025
9862fe1
fix(ci): remove trailing space
mattKorwel Sep 16, 2025
dafed68
fix(ci): resolve linting errors
mattKorwel Sep 16, 2025
2b4aee8
refactor(ci): improve linting job modularity
mattKorwel Sep 16, 2025
ddff891
feat(ci): add prettier to linting job
mattKorwel Sep 16, 2025
2ea6c4d
refactor(ci): simplify local linting command
mattKorwel Sep 16, 2025
c192e16
fix(ci): ensure prettier is found in PATH
mattKorwel Sep 16, 2025
d6f3d4a
feat(ci): add explicit vitest config for test-utils
mattKorwel Sep 16, 2025
035a06b
feat(ci): run workspace tests in parallel
mattKorwel Sep 16, 2025
2629963
feat(ci): split e2e tests into fast and slow jobs
mattKorwel Sep 16, 2025
e80acf4
feat(ci): add lockfile check and parallelize tests
mattKorwel Sep 16, 2025
12086f6
Merge branch 'main' into feature/ci-optimizations
mattKorwel Sep 16, 2025
75e3974
testing clean up
mattKorwel Sep 16, 2025
8303ab9
see if parallel helps
mattKorwel Sep 16, 2025
6e22f9b
hmmm
mattKorwel Sep 16, 2025
d54789c
Merge branch 'main' into feature/ci-optimizations
mattKorwel Sep 18, 2025
4c8547d
fix(ci): add vitest deps config to fix parallel test failures
mattKorwel Sep 18, 2025
61eef2a
fix(ci): update tsconfig to include vitest config
mattKorwel Sep 18, 2025
abe3614
fixing testing set up for parallel tests
mattKorwel Sep 18, 2025
b58276d
fix shared e2e build
mattKorwel Sep 18, 2025
62dff64
fix linting
mattKorwel Sep 18, 2025
653fb8c
merge skipper
mattKorwel Sep 18, 2025
9eedb2a
linting
mattKorwel Sep 18, 2025
2c1cc99
return to build
mattKorwel Sep 18, 2025
be8016f
fighting vscode tests
mattKorwel Sep 18, 2025
076fa93
donot block on slow tess
mattKorwel Sep 18, 2025
d961e41
same for e2e
mattKorwel Sep 18, 2025
af5b269
windows optimizations
mattKorwel Sep 18, 2025
c1fafe5
fixes for windows
mattKorwel Sep 18, 2025
be5ffa0
fix caching
mattKorwel Sep 18, 2025
dc93018
configure more windows performance
mattKorwel Sep 18, 2025
63371dc
clean up node configuration
mattKorwel Sep 18, 2025
788238c
try and add docker directly
mattKorwel Sep 18, 2025
8ac9cb2
esbuild
mattKorwel Sep 18, 2025
21ff419
linting
mattKorwel Sep 18, 2025
8589caf
try and fix macos dependency issue
mattKorwel Sep 18, 2025
45e9cd6
break out windows to not use shared build
mattKorwel Sep 18, 2025
d2f5dd5
Merge branch 'main' into feature/ci-optimizations
mattKorwel Sep 18, 2025
ff9544b
liniting
mattKorwel Sep 18, 2025
250b873
linting
mattKorwel Sep 18, 2025
dc761ac
break out windows in ci
mattKorwel Sep 18, 2025
68f7a7f
update job names
mattKorwel Sep 18, 2025
9344dcb
update job names pt 2
mattKorwel Sep 18, 2025
2b28ea8
Merge branch 'main' into feature/ci-optimizations
mattKorwel Sep 18, 2025
be6f9af
linting
mattKorwel Sep 18, 2025
d2bb9bd
Merge branch 'main' into feature/ci-optimizations
mattKorwel Sep 18, 2025
3aceb4f
Merge branch 'main' into feature/ci-optimizations
mattKorwel Sep 18, 2025
821849a
Merge branch 'main' into feature/ci-optimizations
mattKorwel Sep 18, 2025
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
434 changes: 176 additions & 258 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

243 changes: 212 additions & 31 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,72 @@ on:
merge_group:

jobs:
e2e-test:
name: 'E2E Test (${{ matrix.os }}) - ${{ matrix.sandbox }}'
# This condition ensures the job runs for pushes to main, merge groups,
# PRs from the base repo, OR PRs from forks with the correct label.
merge_queue_skipper:
name: 'Merge Queue Skipper'
runs-on: 'ubuntu-latest'
outputs:
skip: '${{ steps.skipper.outputs.skip }}'
steps:
- name: 'Check if skip'
id: 'skipper'
uses: 'fkirc/skip-duplicate-actions@f75f66ce1886f00957d99748a42c724f4330bdcf' # ratchet:fkirc/skip-duplicate-actions@v5
with:
concurrent_skipping: 'never'
skip_after_successful_duplicate: 'true'
paths_ignore: '["**.md", "docs/**"]'
do_not_skip: '["push", "workflow_dispatch", "schedule"]'

build:
name: 'Build Project'
runs-on: 'gemini-cli-ubuntu-16-core'
needs: 'merge_queue_skipper'
if: "needs.merge_queue_skipper.outputs.skip != 'true'"
steps:
- name: 'Checkout'
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5

- name: 'Set up Node.js'
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: 'Install dependencies'
run: 'npm ci'

- name: 'Build project'
run: 'npm run build'

- name: 'Archive build artifacts'
run: 'tar -cvf build-artifacts.tar bundle/ node_modules/ packages/ package.json npm-shrinkwrap.json'

- name: 'Upload build artifacts'
uses: 'actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02'
with:
name: 'build-artifacts'
path: 'build-artifacts.tar'

e2e_linux:
name: 'E2E Test (Linux) - ${{ matrix.sandbox }}'
needs:
- 'merge_queue_skipper'
- 'build'
if: |
github.event_name == 'push' ||
github.event_name == 'merge_group' ||
(github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event.label.name == 'maintainer:e2e:ok')
runs-on: '${{ matrix.os }}'
needs.merge_queue_skipper.outputs.skip != 'true' && (
github.event_name == 'push' ||
github.event_name == 'merge_group' ||
(github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event.label.name == 'maintainer:e2e:ok')
)
runs-on: 'gemini-cli-ubuntu-16-core'
strategy:
fail-fast: false
matrix:
os:
- 'ubuntu-latest'
- 'macos-latest'
- 'gemini-cli-windows-16-core'
sandbox:
- 'sandbox:none'
- 'sandbox:docker'
node-version:
- '20.x'
exclude:
# Docker tests are not supported on macOS or Windows
- os: 'macos-latest'
sandbox: 'sandbox:docker'
- os: 'gemini-cli-windows-16-core'
sandbox: 'sandbox:docker'

steps:
- name: 'Checkout (fork)'
Expand All @@ -56,22 +94,22 @@ jobs:
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
if: "github.event_name != 'pull_request_target'"

- name: 'Download build artifacts'
uses: 'actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093'
with:
name: 'build-artifacts'
path: '.'

- name: 'Extract build artifacts'
run: 'tar -xvf build-artifacts.tar'

- name: 'Set up Node.js ${{ matrix.node-version }}'
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions-node@v4
with:
node-version: '${{ matrix.node-version }}'

- name: 'Install dependencies'
run: |-
npm ci

- name: 'Build project'
run: |-
npm run build

- name: 'Set up Docker'
if: |-
matrix.os == 'ubuntu-latest' && matrix.sandbox == 'sandbox:docker'
if: "matrix.sandbox == 'sandbox:docker'"
uses: 'docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435' # ratchet:docker/setup-buildx-action@v3

- name: 'Run E2E tests'
Expand All @@ -80,6 +118,149 @@ jobs:
KEEP_OUTPUT: 'true'
SANDBOX: '${{ matrix.sandbox }}'
VERBOSE: 'true'
GEMINI_SANDBOX: 'docker'
shell: 'bash'
run: |-
npm run "test:integration:${SANDBOX}"
run: |
if [[ "${{ matrix.sandbox }}" == "sandbox:docker" ]]; then
npm run build:sandbox
fi
npx vitest run --root ./integration-tests

e2e_slow_platforms:
name: 'Slow E2E - Mac'
needs:
- 'merge_queue_skipper'
- 'build'
if: |
needs.merge_queue_skipper.outputs.skip != 'true' && (
github.event_name == 'push' ||
github.event_name == 'merge_group' ||
(github.event.pull_request.head.repo.full_name == github.repository) ||
(github.event.label.name == 'maintainer:e2e:ok')
)
runs-on: '${{ matrix.os }}'
continue-on-error: true
strategy:
fail-fast: false
matrix:
os:
- 'macos-latest'
node-version:
- '20.x'

steps:
- name: 'Checkout (fork)'
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
if: "github.event_name == 'pull_request_target'"
with:
ref: '${{ github.event.pull_request.head.sha }}'
repository: '${{ github.event.pull_request.head.repo.full_name }}'

- name: 'Checkout (internal)'
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
if: "github.event_name != 'pull_request_target'"

- name: 'Download build artifacts'
uses: 'actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093'
with:
name: 'build-artifacts'
path: '.'

- name: 'Extract build artifacts'
run: 'tar -xvf build-artifacts.tar'

- name: 'Set up Node.js ${{ matrix.node-version }}'
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions-node@v4
with:
node-version: '${{ matrix.node-version }}'

- name: 'Fix rollup optional dependencies on macOS'
if: "runner.os == 'macOS'"
run: |
npm cache clean --force
npm install --no-save @rollup/rollup-darwin-arm64 || true

- name: 'Run E2E tests (non-Windows)'
if: "runner.os != 'Windows'"
env:
GEMINI_API_KEY: '${{ secrets.GEMINI_API_KEY }}'
KEEP_OUTPUT: 'true'
SANDBOX: 'sandbox:none'
VERBOSE: 'true'
run: 'npx vitest run --root ./integration-tests'

e2e_windows:
name: 'Slow E2E - Win'
if: "needs.merge_queue_skipper.outputs.skip != 'true'"
needs:
- 'merge_queue_skipper'
runs-on: 'gemini-cli-windows-16-core'
continue-on-error: true

steps:
- name: 'Checkout (fork)'
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
if: "github.event_name == 'pull_request_target'"
with:
ref: '${{ github.event.pull_request.head.sha }}'
repository: '${{ github.event.pull_request.head.repo.full_name }}'

- name: 'Checkout (internal)'
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
if: "github.event_name != 'pull_request_target'"

- name: 'Set up Node.js 20.x'
uses: 'actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020' # ratchet:actions-node@v4
with:
node-version: '20.x'
cache: 'npm'

- name: 'Configure Windows Defender exclusions'
run: |
Add-MpPreference -ExclusionPath $env:GITHUB_WORKSPACE -Force
Add-MpPreference -ExclusionPath "$env:GITHUB_WORKSPACE\node_modules" -Force
Add-MpPreference -ExclusionPath "$env:GITHUB_WORKSPACE\packages" -Force
Add-MpPreference -ExclusionPath "$env:TEMP" -Force
shell: 'pwsh'

- name: 'Configure npm for Windows performance'
run: |
npm config set progress false
npm config set audit false
npm config set fund false
npm config set loglevel error
npm config set maxsockets 32
npm config set registry https://registry.npmjs.org/
shell: 'pwsh'

- name: 'Install dependencies'
run: 'npm ci'
shell: 'pwsh'

- name: 'Run E2E tests'
env:
GEMINI_API_KEY: '${{ secrets.GEMINI_API_KEY }}'
KEEP_OUTPUT: 'true'
SANDBOX: 'sandbox:none'
VERBOSE: 'true'
NODE_OPTIONS: '--max-old-space-size=32768 --max-semi-space-size=256'
UV_THREADPOOL_SIZE: '32'
NODE_ENV: 'test'
shell: 'pwsh'
run: 'npx vitest run --root ./integration-tests'

e2e:
name: 'E2E'
if: 'always()'
needs:
- 'merge_queue_skipper'
- 'e2e_linux'
runs-on: 'gemini-cli-ubuntu-16-core'
steps:
- name: 'Check E2E test results'
run: |
if [[ ${{ needs.e2e_linux.result }} != 'success' ]]; then
echo "The required E2E test job failed."
exit 1
fi
echo "All required E2E test jobs passed!"
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
"vitest.disableWorkspaceWarning": true
}
9 changes: 8 additions & 1 deletion esbuild.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@
* SPDX-License-Identifier: Apache-2.0
*/

import esbuild from 'esbuild';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { createRequire } from 'node:module';
import { writeFileSync } from 'node:fs';

let esbuild;
try {
esbuild = (await import('esbuild')).default;
} catch (_error) {
console.warn('esbuild not available, skipping bundle step');
process.exit(0);
}

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const require = createRequire(import.meta.url);
Expand Down
8 changes: 7 additions & 1 deletion integration-tests/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ export default defineConfig({
reporters: ['default'],
include: ['**/*.test.ts'],
retry: 2,
fileParallelism: false,
fileParallelism: true,
poolOptions: {
threads: {
minThreads: 8,
maxThreads: 16,
},
},
},
});
Loading
Loading