From b1fbaf836e4a6bf110c529d9bef284eef3e677e8 Mon Sep 17 00:00:00 2001 From: adriancofie <38888889+adriancofie@users.noreply.github.com> Date: Fri, 13 Mar 2026 10:00:54 -0400 Subject: [PATCH] (#15) Configure CI workflow for GitHub Actions Configure GitHub Actions CI pipeline that runs on push and PR to main/develop branches. Includes linting, test coverage, and build across Node.js 20.x and 22.x. Coverage and build artifacts are uploaded and retained for 7 days. Closes #15 --- .github/workflows/ci.yml | 116 +++++++++++++++++++++++++++++++++++++++ package.json | 3 +- 2 files changed, 118 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..6fe0b00 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,116 @@ +name: CI + +on: + push: + branches: [main, develop] + pull_request: + branches: [main, develop] + +permissions: + contents: read + packages: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + name: Lint + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: pnpm + registry-url: https://npm.pkg.github.com + scope: '@nciocpl' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Run linter + run: pnpm run lint + + test: + name: Test (Node ${{ matrix.node-version }}) + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x, 22.x] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: pnpm + registry-url: https://npm.pkg.github.com + scope: '@nciocpl' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Run tests with coverage + run: pnpm run test:coverage + + - name: Upload coverage report + if: matrix.node-version == '20.x' + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage/ + retention-days: 7 + + build: + name: Build (Node ${{ matrix.node-version }}) + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [20.x, 22.x] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: pnpm + registry-url: https://npm.pkg.github.com + scope: '@nciocpl' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + run: pnpm run build + + - name: Upload build artifacts + if: matrix.node-version == '20.x' + uses: actions/upload-artifact@v4 + with: + name: build-output + path: dist/ + retention-days: 7 diff --git a/package.json b/package.json index ae53743..07aed33 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,8 @@ "vitest": "^3.0.0", "vitest-axe": "^0.1.0" }, + "packageManager": "pnpm@8.6.12", "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }