From 384a185a2e652a779930c1b6c86ddf5bcb30f1db Mon Sep 17 00:00:00 2001 From: Cooldude2606 <25043174+Cooldude2606@users.noreply.github.com> Date: Sun, 30 Aug 2026 21:48:43 +0100 Subject: [PATCH] Update the test strategy We now only perform one test on the oldest node version. In addition, timeout values were added and some other small tidy ups. --- .github/workflows/node.js.yml | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 53d16a95..d2e83e7e 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -7,15 +7,27 @@ on: push: pull_request: +env: + NODE_VERSION: 24.x + jobs: test: runs-on: ubuntu-latest + timeout-minutes: 15 strategy: + fail-fast: false matrix: - # Supported versions are active lts and maintenance see https://nodejs.org/en/about/releases/ - node-version: [22.x, 24.x] - # Supported versions are latest stable and one minor version before stable (even if from a previous major) + # Supported node versions are active lts and maintenance see https://nodejs.org/en/about/releases/ + node-version: [24.x] + + # Supported factorio versions are latest stable and one minor version before stable (even if from a previous major) factorio-version: [1.1.110, 2.0.77, 2.1.8] + + # Coverage is performed on the older of the supported node versions + include: + - node-version: 22.x + factorio-version: 2.1.8 + coverage: true steps: - uses: actions/checkout@v4 @@ -29,13 +41,13 @@ jobs: - name: Use Factorio ${{ matrix.factorio-version }} run: wget -q -O factorio.tar.gz https://www.factorio.com/get-download/${{ matrix.factorio-version }}/headless/linux64 && tar -xf factorio.tar.gz && rm factorio.tar.gz - name: Run tests - if: ${{ matrix.node-version != '22.x' || matrix.factorio-version != '1.1.110' }} + if: ${{ !matrix.coverage }} run: pnpm test - name: Run coverage - if: ${{ matrix.node-version == '22.x' && matrix.factorio-version == '1.1.110' }} + if: ${{ matrix.coverage }} run: pnpm run ci-cover - - name : Upload coverage to Codecov - if: ${{ matrix.node-version == '22.x' && matrix.factorio-version == '1.1.110' }} + - name: Upload coverage to Codecov + if: ${{ matrix.coverage }} uses: codecov/codecov-action@v4 with: files: ./coverage/lcov.info @@ -69,7 +81,7 @@ jobs: - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 24.x + node-version: ${{ env.NODE_VERSION }} - name: Prepare and install run: pnpm i --no-frozen-lockfile - name: Build @@ -83,23 +95,25 @@ jobs: lint: runs-on: ubuntu-latest + timeout-minutes: 5 steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 24.x + node-version: ${{ env.NODE_VERSION }} - run: pnpm i --no-frozen-lockfile - run: pnpm run lint build: runs-on: ubuntu-latest + timeout-minutes: 5 steps: - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 24.x + node-version: ${{ env.NODE_VERSION }} - run: pnpm i --no-frozen-lockfile - run: pnpm run build-mod # Upload build to artifacts