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
19 changes: 3 additions & 16 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
# GitHub actions required reviewers
.github/workflows/monaco-editor.yml @hediet @alexdima @lszomoru @joaomoreno
.github/workflows/no-package-lock-changes.yml @lszomoru @joaomoreno @TylerLeonhardt @rzhao271
.github/workflows/no-yarn-lock-changes.yml @lszomoru @joaomoreno @TylerLeonhardt @rzhao271
.github/workflows/pr-darwin-test.yml @lszomoru @joaomoreno @TylerLeonhardt @rzhao271
.github/workflows/pr-linux-cli-test.yml @lszomoru @joaomoreno @TylerLeonhardt @rzhao271
.github/workflows/pr-linux-test.yml @lszomoru @joaomoreno @TylerLeonhardt @rzhao271
.github/workflows/pr-node-modules.yml @lszomoru @joaomoreno @TylerLeonhardt @rzhao271
.github/workflows/pr-win32-test.yml @lszomoru @joaomoreno @TylerLeonhardt @rzhao271
.github/workflows/pr.yml @lszomoru @joaomoreno @TylerLeonhardt @rzhao271
.github/workflows/telemetry.yml @lramos15 @lszomoru @joaomoreno

# VS Code API
# Ensure the API team is aware of changes to the vscode-dts file
# this is only about the final API, not about proposed API changes
src/vscode-dts/vscode.d.ts @jrieken @mjbvz @alexr00
# Code owners for OpenCortexIDE
# All files owned by the repository maintainer
* @pterjudin
80 changes: 80 additions & 0 deletions .github/workflows/_reusable-e2e-sanity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Reusable E2E Sanity Check

on:
workflow_call:
inputs:
platform:
description: 'Platform to run on'
required: false
default: 'ubuntu-latest'
type: string

jobs:
e2e-sanity:
name: E2E Sanity
runs-on: ${{ inputs.platform }}
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc

- name: Restore node_modules cache
id: cache-node-modules
uses: actions/cache/restore@v4
with:
path: node_modules
key: node_modules-e2e-${{ hashFiles('package-lock.json') }}
restore-keys: |
node_modules-e2e-

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1

- name: Cache Playwright browsers
id: cache-playwright
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
playwright-browsers-${{ runner.os }}-

- name: Install Playwright browsers
if: steps.cache-playwright.outputs.cache-hit != 'true'
run: npx playwright install --with-deps chromium
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 0

- name: Transpile client and extensions
run: npm run gulp transpile-client-esbuild transpile-extensions

- name: Run E2E tests
working-directory: test/e2e
run: npx playwright test
env:
CI: true

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ github.run_id }}
path: test/e2e/playwright-report/
retention-days: 7

- name: Cache node_modules
if: steps.cache-node-modules.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: node_modules
key: node_modules-e2e-${{ hashFiles('package-lock.json') }}

52 changes: 52 additions & 0 deletions .github/workflows/_reusable-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Reusable Lint Check

on:
workflow_call:
inputs:
platform:
description: 'Platform to run on'
required: false
default: 'ubuntu-latest'
type: string

jobs:
lint:
name: Lint
runs-on: ${{ inputs.platform }}
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc

- name: Restore node_modules cache
id: cache-node-modules
uses: actions/cache/restore@v4
with:
path: node_modules
key: node_modules-lint-${{ hashFiles('package-lock.json') }}
restore-keys: |
node_modules-lint-

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1

- name: Run ESLint
run: npm run eslint
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Cache node_modules
if: steps.cache-node-modules.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: node_modules
key: node_modules-lint-${{ hashFiles('package-lock.json') }}

126 changes: 126 additions & 0 deletions .github/workflows/_reusable-setup-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Reusable Node.js Setup

on:
workflow_call:
inputs:
node-version-file:
description: 'Path to .nvmrc file'
required: false
default: '.nvmrc'
type: string
cache-key-prefix:
description: 'Prefix for cache keys'
required: false
default: 'node_modules'
type: string
platform:
description: 'Platform (linux, darwin, win32)'
required: false
default: 'linux'
type: string
arch:
description: 'Architecture (x64, arm64)'
required: false
default: 'x64'
type: string

jobs:
setup:
name: Setup Node.js and Cache
runs-on: ${{ inputs.platform == 'darwin' && 'macos-14' || inputs.platform == 'win32' && 'windows-latest' || 'ubuntu-latest' }}
outputs:
cache-hit: ${{ steps.cache-node-modules.outputs.cache-hit }}
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: ${{ inputs.node-version-file }}

- name: Prepare node_modules cache key
id: cache-key
shell: bash
run: |
mkdir -p .build
if [ -f "build/azure-pipelines/common/computeNodeModulesCacheKey.js" ]; then
node build/azure-pipelines/common/computeNodeModulesCacheKey.js ${{ inputs.platform }} ${{ inputs.arch }} $(node -p process.arch) > .build/packagelockhash
else
echo "${{ hashFiles('package-lock.json') }}" > .build/packagelockhash
fi

- name: Restore node_modules cache
id: cache-node-modules
uses: actions/cache/restore@v4
with:
path: .build/node_modules_cache
key: "${{ inputs.cache-key-prefix }}-${{ inputs.platform }}-${{ hashFiles('.build/packagelockhash') }}"
restore-keys: |
${{ inputs.cache-key-prefix }}-${{ inputs.platform }}-

- name: Extract node_modules cache
if: steps.cache-node-modules.outputs.cache-hit == 'true'
shell: bash
run: |
if [ "${{ inputs.platform }}" = "win32" ]; then
# Try 7z first, fallback to PowerShell Expand-Archive if 7z not available
if command -v 7z.exe &> /dev/null; then
7z.exe x .build/node_modules_cache/cache.7z -aoa || true
elif command -v powershell.exe &> /dev/null; then
powershell.exe -Command "Expand-Archive -Path .build/node_modules_cache/cache.7z -DestinationPath . -Force" || true
else
echo "Warning: No extraction tool found for Windows. Skipping cache extraction."
fi
else
tar -xzf .build/node_modules_cache/cache.tgz || true
fi

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
shell: bash
run: |
if [ "${{ inputs.platform }}" = "win32" ]; then
# Windows-specific setup if needed
npm ci
else
npm ci
fi
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create node_modules archive
if: steps.cache-node-modules.outputs.cache-hit != 'true'
shell: bash
run: |
if [ "${{ inputs.platform }}" = "win32" ]; then
if [ -f "build/azure-pipelines/common/listNodeModules.js" ]; then
node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt
mkdir -p .build/node_modules_cache
# Try 7z first, fallback to PowerShell Compress-Archive if 7z not available
if command -v 7z.exe &> /dev/null; then
7z.exe a .build/node_modules_cache/cache.7z -mx3 `@.build/node_modules_list.txt
elif command -v powershell.exe &> /dev/null; then
# PowerShell fallback - note: this creates a zip, not 7z
powershell.exe -Command "Compress-Archive -Path (Get-Content .build/node_modules_list.txt) -DestinationPath .build/node_modules_cache/cache.zip -Force" || echo "Warning: Failed to create archive"
else
echo "Warning: No compression tool found for Windows. Skipping cache creation."
fi
fi
else
if [ -f "build/azure-pipelines/common/listNodeModules.js" ]; then
node build/azure-pipelines/common/listNodeModules.js .build/node_modules_list.txt
mkdir -p .build/node_modules_cache
tar -czf .build/node_modules_cache/cache.tgz --files-from .build/node_modules_list.txt
fi
fi

- name: Save node_modules cache
if: steps.cache-node-modules.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: .build/node_modules_cache
key: "${{ inputs.cache-key-prefix }}-${{ inputs.platform }}-${{ hashFiles('.build/packagelockhash') }}"

68 changes: 68 additions & 0 deletions .github/workflows/_reusable-smoke-headless.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Reusable Headless Smoke Test

on:
workflow_call:
inputs:
platform:
description: 'Platform to run on'
required: false
default: 'ubuntu-latest'
type: string

jobs:
smoke-headless:
name: Headless Smoke Test
runs-on: ${{ inputs.platform }}
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version-file: .nvmrc

- name: Restore node_modules cache
id: cache-node-modules
uses: actions/cache/restore@v4
with:
path: node_modules
key: node_modules-smoke-${{ hashFiles('package-lock.json') }}
restore-keys: |
node_modules-smoke-

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
env:
ELECTRON_SKIP_BINARY_DOWNLOAD: 1
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Transpile client and extensions
run: npm run gulp transpile-client-esbuild transpile-extensions

- name: Download Electron
run: npm run electron
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Compile smoke tests
working-directory: test/smoke
run: npm run compile

- name: Compile extensions for smoke tests
run: npm run gulp compile-extension-media

- name: Run headless smoke test
run: npm run smoketest-no-compile -- --headless --quick || npm run smoketest-no-compile -- --web --headless --quick
continue-on-error: false

- name: Cache node_modules
if: steps.cache-node-modules.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: node_modules
key: node_modules-smoke-${{ hashFiles('package-lock.json') }}

Loading
Loading