From 1b5146ccee7e4720615e29202f814c32960fa6e6 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 5 Nov 2025 12:56:36 +0100 Subject: [PATCH 1/6] Add a GitHub Action to run npm test * https://docs.github.com/en/actions/tutorials/build-and-test-code/nodejs * https://github.com/actions/setup-node --- .github/workflows/ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..ae576f71 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +# https://docs.github.com/en/actions/tutorials/build-and-test-code/nodejs +# https://github.com/actions/setup-node + +name: ci +on: + push: + pull_request: + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-node@v6 + with: + node-version: 'lts/*' + - run: npm ci + - run: npm run build --if-present + - run: npm test From df0675e310b19aa03db6a3c380d7209c0c79d026 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 5 Nov 2025 12:59:25 +0100 Subject: [PATCH 2/6] Add installation of X11 development libraries --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae576f71..733b6512 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ jobs: build: runs-on: ubuntu-latest steps: + - run: sudo apt-get update && sudo apt-get install -y libx11-dev libxi-dev libxext-dev - uses: actions/checkout@v5 - uses: actions/setup-node@v6 with: From d7aab21a965372350c6704ca92c378fdc90632bb Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 5 Nov 2025 13:06:16 +0100 Subject: [PATCH 3/6] libgl1-mesa-dev libglx-dev libx11-dev libxext-dev libxi-dev --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 733b6512..c9659c24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest steps: - - run: sudo apt-get update && sudo apt-get install -y libx11-dev libxi-dev libxext-dev + - run: sudo apt-get update && sudo apt-get install -y libgl1-mesa-dev libglx-dev libx11-dev libxext-dev libxi-dev - uses: actions/checkout@v5 - uses: actions/setup-node@v6 with: From 7577763c90c53843d218946980079634513eda22 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 5 Nov 2025 13:36:28 +0100 Subject: [PATCH 4/6] Refactor CI workflow to use matrix for Node versions --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9659c24..8aea2c1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,14 +7,17 @@ on: pull_request: workflow_dispatch: jobs: - build: + ci: + strategy: + matrix: # Remove 24.x until dependencies are compatible + node-version: ['20.x', '22.x'] # , 'lts/*'] runs-on: ubuntu-latest steps: - run: sudo apt-get update && sudo apt-get install -y libgl1-mesa-dev libglx-dev libx11-dev libxext-dev libxi-dev - uses: actions/checkout@v5 - uses: actions/setup-node@v6 with: - node-version: 'lts/*' + node-version: ${{ matrix.node-version }} - run: npm ci - run: npm run build --if-present - run: npm test From b5a56a4f3ecb4327c709edbe89e1f5ba4b2ba883 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 5 Nov 2025 13:40:32 +0100 Subject: [PATCH 5/6] Update CI workflow to include lts/* node version --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8aea2c1e..a18c81d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,8 +9,9 @@ on: jobs: ci: strategy: + fail-fast: false matrix: # Remove 24.x until dependencies are compatible - node-version: ['20.x', '22.x'] # , 'lts/*'] + node-version: ['20.x', '22.x', 'lts/*'] runs-on: ubuntu-latest steps: - run: sudo apt-get update && sudo apt-get install -y libgl1-mesa-dev libglx-dev libx11-dev libxext-dev libxi-dev From ec15f8148844c046acf6e74809bbcd420981b8ea Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Wed, 5 Nov 2025 13:47:03 +0100 Subject: [PATCH 6/6] Modify CI workflow for canvas and gl dependencies Updated CI workflow to install additional dependencies and run tests with xvfb. --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a18c81d6..59f69753 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,11 +14,12 @@ jobs: node-version: ['20.x', '22.x', 'lts/*'] runs-on: ubuntu-latest steps: - - run: sudo apt-get update && sudo apt-get install -y libgl1-mesa-dev libglx-dev libx11-dev libxext-dev libxi-dev + - run: sudo apt-get update && sudo apt-get install -y libgl1-mesa-dev libgles2-mesa-dev libglx-dev libx11-dev libxext-dev libxi-dev - uses: actions/checkout@v5 - uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} + - run: npm install canvas gl --unsafe-perm - run: npm ci - run: npm run build --if-present - - run: npm test + - run: xvfb-run -a npm test