From da6b3d6b5ad2118bff18ec6a6720e13f42f78bd4 Mon Sep 17 00:00:00 2001 From: Byron Sommardahl Date: Thu, 18 Apr 2024 18:54:10 +0000 Subject: [PATCH] Add unit test job. --- .github/workflows/ci-cd.yaml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 850c2eb..1192d35 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -9,7 +9,8 @@ jobs: build: name: ๐Ÿ› ๏ธ Build Frontend Artifact needs: - - audit + - lint + - test runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -67,4 +68,28 @@ jobs: run: cd frontend && npm i - name: ๐Ÿ˜‚ Lint code - run: cd frontend && npm run lint \ No newline at end of file + run: cd frontend && npm run lint + + test: + name: ๐Ÿงช Run Unit Tests + needs: audit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup Node 16 + uses: actions/setup-node@v3 + with: + node-version: 16.x + + - name: Cache Node Modules + uses: actions/cache@v3 + with: + path: frontend/node_modules + key: fe-node-${{ hashFiles('frontend/package-lock.json') }} + + - name: Install deps + run: cd frontend && npm i + + - name: Run the unit tests + run: cd frontend && npm run test-ci \ No newline at end of file