From 85d47c46c4347201d49796fc87bf57527fa485a6 Mon Sep 17 00:00:00 2001 From: Enguerrand de Ribaucourt Date: Wed, 21 Jan 2026 17:48:00 +0100 Subject: [PATCH 1/8] CI: Run the main workflow on a self-hosted runner We started experiencing timeouts on the default GitHub runners due to the lengthy setup time for the Yocto build environment. This change modifies the main CI workflow to utilize a self-hosted runner that has less computing limitations. --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9305c060..e6066a7a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,11 +10,14 @@ on: pull_request: branches: - '*' + schedule: # This run is just to keep the self-hosted runner active. They get deleted after 14 days of inactivity. + - cron: '0 8 * * 1' # Run weekly on Mondays at 9AM CET (8AM UTC) jobs: build-test-vscode: - runs-on: ubuntu-latest + # We need a faster runner with a Yocto cache in order for the tests to complete in time + runs-on: self-hosted defaults: run: From 0247f00a16c711bb88b07b02733cdfe8de530a50 Mon Sep 17 00:00:00 2001 From: Enguerrand de Ribaucourt Date: Wed, 21 Jan 2026 17:48:50 +0100 Subject: [PATCH 2/8] CI: use NFS cache for Yocto on self-hosted runner Speed up the pipeline by reusing the Yocto download and sstate cache directories on the self-hosted runner via NFS mounts. Mostly for `devtool modify busybox` which needs to build quilt-native and a few other recipes. --- .github/workflows/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e6066a7a..ff2dbb0f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -99,6 +99,11 @@ jobs: - name: Test Project run: npm run test + env: + # NFS Yocto cache directories on the self-hosted runner + DL_DIR: /var/cache/yocto/yocto-dldir + SSTATE_DIR: /var/cache/yocto/yocto-sstate + BB_ENV_PASSTHROUGH_ADDITIONS: "DL_DIR SSTATE_DIR" - name: Build the VSIX run: npm run package From ca7182f55380ec57c6e6efc00cf46f602e5c7b55 Mon Sep 17 00:00:00 2001 From: Enguerrand de Ribaucourt Date: Wed, 21 Jan 2026 17:51:37 +0100 Subject: [PATCH 3/8] CI: remove apparmor workaround The self-hosted runner is already configured to allow unprivileged user namespaces, contrarily to the default GitHub-hosted runners. Therefore, this step is not needed and can be removed. --- .github/workflows/main.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ff2dbb0f..5c1f2f73 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,9 +29,6 @@ jobs: node-version: 20 steps: - - name: Enable unprivileged user namespaces - run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns - - name: Checkout Repository uses: actions/checkout@v4 From 5331f544a2ef70704ecbde84d2cef55345e4f679 Mon Sep 17 00:00:00 2001 From: Enguerrand de Ribaucourt Date: Wed, 21 Jan 2026 18:01:46 +0100 Subject: [PATCH 4/8] CI: remove apt dependencies installation The packages are already installed on the self-hosted runner. --- .github/workflows/main.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5c1f2f73..e6c3ad25 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,9 +50,6 @@ jobs: git config --global user.name "${GITHUB_ACTOR}" git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" - - name: Install apt dependencies - run: sudo apt install chrpath diffstat - - name: Cache fetch id: cache-fetch uses: actions/cache@v4 From 320a8b708a48666a75a37d99bffc3cf6d8dd237d Mon Sep 17 00:00:00 2001 From: Enguerrand de Ribaucourt Date: Thu, 22 Jan 2026 09:55:02 +0100 Subject: [PATCH 5/8] CI: cleanup on success The self-hosted runner reuses the workspace after each workflow. This means we now need to clean up after ourselves to avoid polluting the workspace for the next run. We keep it on failure to allow debugging. --- .github/workflows/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e6c3ad25..41850980 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -108,6 +108,10 @@ jobs: name: vscode-bitbake path: ./yocto-bitbake*.vsix + - name: Cleanup + if: success() + run: npm run clean + # Inspired by https://github.com/microsoft/vscode-platform-specific-sample/blob/a0192a21122dfa5c90934b006f027cdf4e4d892d/.github/workflows/ci.yml#L64C11-L64C11 MIT License publish-vsce: runs-on: ubuntu-latest From 5d6d83fe8bcdfe95deaed14dad46df4a34db5c05 Mon Sep 17 00:00:00 2001 From: Enguerrand de Ribaucourt Date: Thu, 22 Jan 2026 09:55:51 +0100 Subject: [PATCH 6/8] CI: use a bigger timeout for bitbake builds We now separate the timeouts for bitbake commands that just do some parsing, and those that do actual builds. --- .../src/__tests__/unit-tests/driver/scanner.test.ts | 11 +++++++++-- client/src/utils/ProcessUtils.ts | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/client/src/__tests__/unit-tests/driver/scanner.test.ts b/client/src/__tests__/unit-tests/driver/scanner.test.ts index 8872973d..d9c8f01a 100644 --- a/client/src/__tests__/unit-tests/driver/scanner.test.ts +++ b/client/src/__tests__/unit-tests/driver/scanner.test.ts @@ -7,7 +7,7 @@ import path from 'path' import fs from 'fs' import { BitBakeProjectScanner } from '../../../driver/BitBakeProjectScanner' import { BitbakeDriver } from '../../../driver/BitbakeDriver' -import { BITBAKE_TIMEOUT } from '../../../utils/ProcessUtils' +import { BITBAKE_BUILD_TIMEOUT, BITBAKE_TIMEOUT } from '../../../utils/ProcessUtils' import { mockVscodeEvents } from '../../utils/vscodeMock' import { importRecipe, removeRecipe, integrationBitbakeFolder } from '../../utils/bitbake' import { logger } from '../../../lib/src/utils/OutputLogger' @@ -54,7 +54,14 @@ describe('BitBakeProjectScanner', () => { }, (error) => { throw error }) - }, BITBAKE_TIMEOUT) + // Running devtool modify needs to build uninative, quilt-native, and a few recipes + // Since the age of AI, fetching anything now takes ages, so we increase the timeout + // Note that such a timeout is only possible on Github self-hosted runners or local machines + // Public Github runners have a max timeout of 1 hour per job + // The workspace is kept for the remaining tests, so we don't need to do it again + // Also, our self-hosted runner have a Yocto sstate cache, so it's only + // rebuilt when changing the openembedded version + }, BITBAKE_BUILD_TIMEOUT) afterAll((done) => { bitBakeProjectScanner.bitbakeDriver.spawnBitbakeProcess('devtool reset busybox').then((child) => { diff --git a/client/src/utils/ProcessUtils.ts b/client/src/utils/ProcessUtils.ts index 2c17698c..9e8eab28 100644 --- a/client/src/utils/ProcessUtils.ts +++ b/client/src/utils/ProcessUtils.ts @@ -36,7 +36,8 @@ function importFromVSCode (id: string): NodeRequire { // The conversion allows the linter to understand the type of the imported module export const pty = importFromVSCode('node-pty') as unknown as typeof nodepty -export const BITBAKE_TIMEOUT = 600000 // 10 minutes +export const BITBAKE_TIMEOUT = 300000 // 3 minutes +export const BITBAKE_BUILD_TIMEOUT = 600000 // 10 minutes export const BITBAKE_EXIT_TIMEOUT = 30000 export type KillProcessFunction = (child: nodepty.IPty) => Promise From 96251f7400f3f7656e7b49a832cfca0a75874ed9 Mon Sep 17 00:00:00 2001 From: Enguerrand de Ribaucourt Date: Thu, 22 Jan 2026 10:08:29 +0100 Subject: [PATCH 7/8] CI: increase timeout on injection test This test needs to initiate the bitbake parser, which can take a while and the previous timeout was too low and failed. --- client/src/__tests__/unit-tests/driver/bitbake-driver.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/__tests__/unit-tests/driver/bitbake-driver.test.ts b/client/src/__tests__/unit-tests/driver/bitbake-driver.test.ts index 0fec9fa4..8c68c94b 100644 --- a/client/src/__tests__/unit-tests/driver/bitbake-driver.test.ts +++ b/client/src/__tests__/unit-tests/driver/bitbake-driver.test.ts @@ -6,6 +6,7 @@ import * as fs from 'fs' import { BitbakeDriver } from '../../../driver/BitbakeDriver' import { type BitbakeTaskDefinition } from '../../../ui/BitbakeTaskProvider' +import { BITBAKE_TIMEOUT } from '../../../utils/ProcessUtils' describe('BitbakeDriver Tests', () => { it('should protect from shell injections', (done) => { @@ -22,7 +23,7 @@ describe('BitbakeDriver Tests', () => { done() }) }) - }) + }, BITBAKE_TIMEOUT) it('should source the environment script', (done) => { const fakeEnvScriptPath = '/tmp/bitbake-vscode-test/envsetup.sh' From b088cf745ea96945f1e6854cb6408fdb6e84a5c4 Mon Sep 17 00:00:00 2001 From: Enguerrand de Ribaucourt Date: Thu, 22 Jan 2026 10:36:09 +0100 Subject: [PATCH 8/8] CI: run on push only to main branches It looks like the actions rules now trigger for pull request and push on the pull request branches, causing double runs for PRs. There's only a need to run on push to main branches. --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 41850980..01d565ca 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,7 +4,8 @@ on: workflow_dispatch: push: branches: - - '*' + - 'staging' + - 'main' tags: - "v*" pull_request: