diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f811a5..12c7a5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,18 @@ on: pull_request: jobs: - verify: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - run: npm ci + - run: npm run lint + + test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -16,4 +27,37 @@ jobs: cache: npm - run: npm ci - run: npm test + + dependency-audit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - run: npm ci + - run: npm audit --audit-level=high + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + - run: npm ci - run: npm run build + + verify: + if: ${{ always() }} + needs: [lint, test, dependency-audit, build] + runs-on: ubuntu-latest + steps: + - name: Require all cAPI CI gates + run: | + test "${{ needs.lint.result }}" = "success" + test "${{ needs.test.result }}" = "success" + test "${{ needs.dependency-audit.result }}" = "success" + test "${{ needs.build.result }}" = "success" diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..b97117b --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,7 @@ +import { defineConfig, globalIgnores } from "eslint/config"; +import nextVitals from "eslint-config-next/core-web-vitals"; + +export default defineConfig([ + ...nextVitals, + globalIgnores([".next/**", "out/**", "build/**", "next-env.d.ts"]), +]); diff --git a/package.json b/package.json index a627665..78bbed0 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint", + "lint": "eslint .", "test": "vitest run" }, "dependencies": {