From 930bf2a854f5f49a8572938d65b34dcd7a6fe771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Palma?= Date: Sat, 17 Aug 2024 01:44:34 +0100 Subject: [PATCH] chore: add codeanalysis action with vitest tests --- .github/workflows/codeanalysis.yaml | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/codeanalysis.yaml diff --git a/.github/workflows/codeanalysis.yaml b/.github/workflows/codeanalysis.yaml new file mode 100644 index 00000000..e0e9c3ca --- /dev/null +++ b/.github/workflows/codeanalysis.yaml @@ -0,0 +1,44 @@ +name: Code analysis + +on: + push: + branches: + - develop + - main + pull_request: + branches: + - develop + - main + +jobs: + test-react-testing-library: + runs-on: ubuntu-latest + name: Run react testing library tests + + strategy: + matrix: + node-version: [21.x] + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + + - name: Cache dependencies + uses: actions/cache@v3 + with: + path: | + **/node_modules + key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} + + - name: Install dependencies + run: npm install + + - name: Build code + run: npm run build + + - name: Run tests + run: CI=true npm run test-coverage +