diff --git a/.github/workflows/run-checks.yml b/.github/workflows/run-checks.yml new file mode 100644 index 00000000..fe084d3b --- /dev/null +++ b/.github/workflows/run-checks.yml @@ -0,0 +1,29 @@ +name: Run Checks + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + run-checks: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "npm" + + - name: Install dependencies + run: npm ci + + - name: Build React project + run: npm run build + + - name: Run linter + run: npm run lint diff --git a/.prettierignore b/.prettierignore index 5f0d66e0..ecabd17c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,3 +1,4 @@ build public/static -node_modules \ No newline at end of file +node_modules +*.yml \ No newline at end of file diff --git a/package.json b/package.json index 20b7a26b..e491a42a 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "postbuild": "cp build/index.html build/404.html", "test": "react-scripts test", "eject": "react-scripts eject", - "format": "npx prettier --write ." + "format": "npx prettier --write .", + "lint": "eslint src" }, "eslintConfig": { "extends": [