From e4f055be3ac04f9af669caf740c23f088f3ba2d9 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Thu, 16 May 2024 17:21:48 -0700 Subject: [PATCH] chore: add GitHub Actions workflow to test builds (#121) * chore: add Github action to test builds * fix: remove 14 and 16 Node * fix: remove npm run test * chore: update yml * ci: add linting * Rename node.js.yml to run-checks.yml * ci: rename job * chore: remove outdated comments --- .github/workflows/run-checks.yml | 29 +++++++++++++++++++++++++++++ .prettierignore | 3 ++- package.json | 3 ++- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/run-checks.yml 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": [