diff --git a/.github/actions/ci-setup/action.yml b/.github/actions/ci-setup/action.yml new file mode 100644 index 0000000..2ae1ae6 --- /dev/null +++ b/.github/actions/ci-setup/action.yml @@ -0,0 +1,20 @@ +name: CI setup + +description: 'Setup node, pnpm and install project dependencies for CI jobs' + +runs: + using: composite + steps: + - 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 new file mode 100644 index 0000000..59046ab --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI + +permissions: + contents: read + +on: + push: + branches: + - main + + pull_request: + branches: + - main + +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 + + - name: Lint + run: pnpm lint + + typecheck: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Setup environment + uses: ./.github/actions/ci-setup + + - name: Typecheck + run: pnpm typecheck + + test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Setup environment + uses: ./.github/actions/ci-setup + + - name: Test + run: pnpm test 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/.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": [ 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": {