From f738625a6fbea955acf3ee90f40c1b43b2285640 Mon Sep 17 00:00:00 2001 From: Lucas Gauthier <67895410+lucasgauthier@users.noreply.github.com> Date: Sun, 15 Feb 2026 16:13:19 +0100 Subject: [PATCH 1/9] add GitHub Actions CI workflow --- .github/workflows/ci.yml | 80 ++++++++++++++++++++++++++++++++++++++++ .vscode/settings.json | 3 +- 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ac94d49 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,80 @@ +name: CI + +on: + push: + branches: + - main + + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set node + uses: actions/setup-node@v4 + with: + node-version: 24.10.0 + cache: pnpm + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10.28.2 + + - name: Install dependencies + run: pnpm i --frozen-lockfile + + - name: Lint + run: pnpm lint + + typecheck: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set node + uses: actions/setup-node@v4 + with: + node-version: 24.10.0 + cache: pnpm + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10.28.2 + + - name: Install dependencies + run: pnpm i --frozen-lockfile + + - name: Typecheck + run: pnpm typecheck + + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set node + uses: actions/setup-node@v4 + with: + node-version: 24.10.0 + cache: pnpm + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 10.28.2 + + - name: Install dependencies + run: pnpm i --frozen-lockfile + + - name: Test + run: pnpm test diff --git a/.vscode/settings.json b/.vscode/settings.json index 1e788dc..279b2b1 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -29,7 +29,8 @@ "markdown", "json", "jsonc", - "yaml" + "yaml", + "github-actions-workflow" ], "eslint.workingDirectories": [ From 149eda6e0b47c5dc8d985bf0e1f61021e5f56c7d Mon Sep 17 00:00:00 2001 From: Lucas Gauthier <67895410+lucasgauthier@users.noreply.github.com> Date: Sun, 15 Feb 2026 18:32:57 +0100 Subject: [PATCH 2/9] remove cache option --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac94d49..69e8b1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: 24.10.0 - cache: pnpm - name: Install pnpm uses: pnpm/action-setup@v4 @@ -43,7 +42,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: 24.10.0 - cache: pnpm - name: Install pnpm uses: pnpm/action-setup@v4 @@ -66,7 +64,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: 24.10.0 - cache: pnpm - name: Install pnpm uses: pnpm/action-setup@v4 From 76456fb145750f48a5dbe41e41b798b7cd120801 Mon Sep 17 00:00:00 2001 From: Lucas Gauthier <67895410+lucasgauthier@users.noreply.github.com> Date: Sun, 15 Feb 2026 18:34:41 +0100 Subject: [PATCH 3/9] break lint (on purpose to check CI) --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 93ffe3b..31b3048 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,7 @@ import assert from 'node:assert' import { add, complex, multiply } from 'mathjs' export type ComplexFunction = (t: number) => Complex - + const INCREMENT = 1e-3 /** From 287e810d97aebd4bab08364489a1f2f73b023c8b Mon Sep 17 00:00:00 2001 From: Lucas Gauthier <67895410+lucasgauthier@users.noreply.github.com> Date: Sun, 15 Feb 2026 18:35:41 +0100 Subject: [PATCH 4/9] fix lint (revert) --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 31b3048..93ffe3b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,7 @@ import assert from 'node:assert' import { add, complex, multiply } from 'mathjs' export type ComplexFunction = (t: number) => Complex - + const INCREMENT = 1e-3 /** From 9ea4bd5f7fe7107c7f8a6b88d3320ea96f148aa3 Mon Sep 17 00:00:00 2001 From: Lucas Gauthier <67895410+lucasgauthier@users.noreply.github.com> Date: Sun, 15 Feb 2026 18:47:54 +0100 Subject: [PATCH 5/9] add permissions section to CI workflow --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69e8b1c..4bd2e32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,8 @@ name: CI +permissions: + contents: read + on: push: branches: From a3ec10f50d16e0f8f2df930b88454e775df2bafc Mon Sep 17 00:00:00 2001 From: Lucas Gauthier <67895410+lucasgauthier@users.noreply.github.com> Date: Sun, 15 Feb 2026 18:48:35 +0100 Subject: [PATCH 6/9] add .nvmrc file and specify Node.js version in package.json --- .nvmrc | 1 + package.json | 1 + 2 files changed, 2 insertions(+) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..2165135 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +24.10.0 diff --git a/package.json b/package.json index c1ae743..c3439a4 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "dist" ], "engines": { + "node": ">=24.10.0", "pnpm": ">=10.28.2" }, "scripts": { From c1a1ec60b9ea8f9676514ea0bd8c60cfd378f345 Mon Sep 17 00:00:00 2001 From: Lucas Gauthier <67895410+lucasgauthier@users.noreply.github.com> Date: Sun, 15 Feb 2026 18:52:17 +0100 Subject: [PATCH 7/9] refactor CI configuration to use .nvmrc for Node.js version --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bd2e32..f3b32bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: - name: Set node uses: actions/setup-node@v4 with: - node-version: 24.10.0 + node-version-file: .nvmrc - name: Install pnpm uses: pnpm/action-setup@v4 @@ -44,7 +44,7 @@ jobs: - name: Set node uses: actions/setup-node@v4 with: - node-version: 24.10.0 + node-version-file: .nvmrc - name: Install pnpm uses: pnpm/action-setup@v4 @@ -66,7 +66,7 @@ jobs: - name: Set node uses: actions/setup-node@v4 with: - node-version: 24.10.0 + node-version-file: .nvmrc - name: Install pnpm uses: pnpm/action-setup@v4 From 955cc5ad9a5960bf4368e781b29fa733f49cfa05 Mon Sep 17 00:00:00 2001 From: Lucas Gauthier <67895410+lucasgauthier@users.noreply.github.com> Date: Sun, 15 Feb 2026 21:26:25 +0100 Subject: [PATCH 8/9] refactor CI workflow to use centralized CI setup action --- .github/actions/ci-setup/action.yml | 23 +++++++++++++ .github/workflows/ci.yml | 51 ++++------------------------- 2 files changed, 29 insertions(+), 45 deletions(-) create mode 100644 .github/actions/ci-setup/action.yml diff --git a/.github/actions/ci-setup/action.yml b/.github/actions/ci-setup/action.yml new file mode 100644 index 0000000..1cfcc38 --- /dev/null +++ b/.github/actions/ci-setup/action.yml @@ -0,0 +1,23 @@ +name: CI setup + +description: 'Setup node, pnpm and install project dependencies for CI jobs' + +runs: + using: composite + steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Set node + uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 + with: + node-version-file: .nvmrc + + - name: Install pnpm + uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0 + with: + version: 10.28.2 + + - name: Install dependencies + shell: bash + run: pnpm i --frozen-lockfile diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3b32bb..60f7ae6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,21 +16,8 @@ jobs: lint: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set node - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 10.28.2 - - - name: Install dependencies - run: pnpm i --frozen-lockfile + - name: Setup environment + uses: ./.github/actions/ci-setup - name: Lint run: pnpm lint @@ -38,21 +25,8 @@ jobs: typecheck: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set node - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 10.28.2 - - - name: Install dependencies - run: pnpm i --frozen-lockfile + - name: Setup environment + uses: ./.github/actions/ci-setup - name: Typecheck run: pnpm typecheck @@ -60,21 +34,8 @@ jobs: test: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set node - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 10.28.2 - - - name: Install dependencies - run: pnpm i --frozen-lockfile + - name: Setup environment + uses: ./.github/actions/ci-setup - name: Test run: pnpm test From 57f42418ddba1018a4617c39ed6d404d63901086 Mon Sep 17 00:00:00 2001 From: Lucas Gauthier <67895410+lucasgauthier@users.noreply.github.com> Date: Sun, 15 Feb 2026 21:33:12 +0100 Subject: [PATCH 9/9] fix checkout step --- .github/actions/ci-setup/action.yml | 3 --- .github/workflows/ci.yml | 9 +++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/actions/ci-setup/action.yml b/.github/actions/ci-setup/action.yml index 1cfcc38..2ae1ae6 100644 --- a/.github/actions/ci-setup/action.yml +++ b/.github/actions/ci-setup/action.yml @@ -5,9 +5,6 @@ description: 'Setup node, pnpm and install project dependencies for CI jobs' runs: using: composite steps: - - name: Checkout code - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Set node uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60f7ae6..59046ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,9 @@ jobs: lint: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Setup environment uses: ./.github/actions/ci-setup @@ -25,6 +28,9 @@ jobs: typecheck: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Setup environment uses: ./.github/actions/ci-setup @@ -34,6 +40,9 @@ jobs: test: runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Setup environment uses: ./.github/actions/ci-setup