Skip to content

Commit

Permalink
chore(ci): Configure eslint in CI
Browse files Browse the repository at this point in the history
* Run `next lint` on pull requests
  • Loading branch information
hairmare committed Feb 4, 2025
1 parent 629243a commit 4e96a3f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test

on:
pull_request:

env:
IMAGES_HOSTNAME: "*"

jobs:
next-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v2
with:
node-version: 22
cache: yarn
cache-dependency-path: next/yarn.lock

- name: Install eslint (for easier rebasing, could be added to packages.json later)
working-directory: ./next
run: yarn add --dev eslint-config-next 'eslint@^8'

- name: Install dependencies
working-directory: ./next
run: yarn install --frozen-lockfile

- name: Running linter
working-directory: ./next
run: yarn run next lint --output-file ../next-eslint_report.json --format json
continue-on-error: true

- name: Annotate Code Linting Results
uses: ataylorme/eslint-annotate-action@v3
with:
report-json: "next-eslint_report.json"
only-pr-files: false
continue-on-error: true
3 changes: 3 additions & 0 deletions next/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["next", "next/typescript"]
}
3 changes: 2 additions & 1 deletion next/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ RUN \

# Rebuild the source code only when needed
FROM base AS builder

WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
Expand Down Expand Up @@ -70,4 +71,4 @@ ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]

COPY healthcheck.mjs ./healthcheck.mjs
HEALTHCHECK --interval=12s --timeout=12s --start-period=30s CMD node healthcheck.mjs
HEALTHCHECK --interval=12s --timeout=12s --start-period=30s CMD node healthcheck.mjs
1 change: 1 addition & 0 deletions next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"private": true,
"scripts": {
"dev": "next dev",
"lint": "next lint",
"build": "next build",
"start": "node .next/standalone/server.js",
"syncDataModel": "node bin/syncDataModel.js",
Expand Down

0 comments on commit 4e96a3f

Please sign in to comment.