From a1a1c80b0b55510880b9837961de9b9cc5cc7aa4 Mon Sep 17 00:00:00 2001 From: Jesse Snyder Date: Thu, 23 May 2024 22:06:25 -0600 Subject: [PATCH] Create test-and-lint.yaml --- .github/workflows/test-and-lint.yaml | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/test-and-lint.yaml diff --git a/.github/workflows/test-and-lint.yaml b/.github/workflows/test-and-lint.yaml new file mode 100644 index 0000000..7419fff --- /dev/null +++ b/.github/workflows/test-and-lint.yaml @@ -0,0 +1,34 @@ +name: Test and Lint + +on: + pull_request: + push: + branches: + - "main" + +jobs: + test-and-lint-front-end: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./web + steps: + - uses: actions/checkout@master + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + - uses: actions/cache@v4 + id: cache-node-modules + with: + path: "web/node_modules" + key: ${{ runner.os }}-modules-${{ hashFiles('web/package-lock.json') }} + - name: Install Dependencies + if: steps.cache-node-modules.outputs.cache-hit != 'true' + run: npm install + - name: Copy env file + run: cp .env.example .env + - name: Lint + run: npm run lint + - name: Test + run: CI=true npm run test