From 4157d2ee08d017cb94380d166cc09ce7ca1bf95e Mon Sep 17 00:00:00 2001 From: Harel M Date: Tue, 3 Mar 2026 12:35:46 +0200 Subject: [PATCH] Fix e2e, use nvmrc where needed (#1684) Updates CI to use nvmrc where needed. Fix e2e test according to configuration in maplibre-gl-js for webgl correct definitions in chrome. --- .github/workflows/ci.yml | 9 +++++++++ cypress.config.ts | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d09a78c..a23069d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,6 +92,9 @@ jobs: - name: Checkout uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: { persist-credentials: false } + - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version-file: '.nvmrc' - run: npm ci - run: npm run test-unit-ci - name: Upload coverage reports to Codecov @@ -110,6 +113,9 @@ jobs: - name: Checkout uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: { persist-credentials: false } + - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version-file: '.nvmrc' - run: npm ci - name: Cypress run uses: cypress-io/github-action@7ef72e250a9e564efb4ed4c2433971ada4cc38b4 # v6.10.4 @@ -131,6 +137,9 @@ jobs: - name: Checkout uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: { persist-credentials: false } + - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version-file: '.nvmrc' - run: npm ci - name: Cypress run uses: cypress-io/github-action@7ef72e250a9e564efb4ed4c2433971ada4cc38b4 # v6.10.4 diff --git a/cypress.config.ts b/cypress.config.ts index 0314d827..b51c0a71 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -13,6 +13,15 @@ export default defineConfig({ setupNodeEvents(on, config) { // implement node event listeners here require("@cypress/code-coverage/task")(on, config); + on("before:browser:launch", (browser, launchOptions) => { + if (browser.family !== "chromium") { + return; + } + launchOptions.args.push("--disable-gpu"); + launchOptions.args.push("--enable-features=AllowSwiftShaderFallback,AllowSoftwareGLFallbackDueToCrashes"); + launchOptions.args.push("--enable-unsafe-swiftshader"); + return launchOptions; + }); return config; }, baseUrl: "http://localhost:8888",