diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..87141d8 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,49 @@ +name: PR Check + +on: + pull_request: + branches: [main, development] + +jobs: + pr-check: + name: PR Check + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + run_install: false + + - name: Get pnpm store directory + id: pnpm-cache + run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_OUTPUT + + - name: Cache pnpm store + uses: actions/cache@v4 + with: + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm- + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Lint + run: pnpm lint + + - name: Test + run: pnpm test --ci + + - name: Type check + run: pnpm exec tsc --noEmit diff --git a/src/__tests__/components/landing/hero.test.tsx b/src/__tests__/components/landing/hero.test.tsx index f122daf..53f8e6a 100644 --- a/src/__tests__/components/landing/hero.test.tsx +++ b/src/__tests__/components/landing/hero.test.tsx @@ -17,9 +17,7 @@ describe("Hero", () => { it("renders the heading and CTA", () => { render(); - expect( - screen.getByRole("heading", { level: 1 }), - ).toBeInTheDocument(); + expect(screen.getByRole("heading", { level: 1 })).toBeInTheDocument(); expect( screen.getByRole("button", { name: /explore your metrics/i }),