From 0a23c2ff3383a18c09890108a78ad22091ebac0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Ord=C3=A1s?= <3125580+davorpa@users.noreply.github.com> Date: Thu, 15 Sep 2022 12:33:55 +0200 Subject: [PATCH] add test job to ci/cd pipeline --- .github/workflows/webapp.yml | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/webapp.yml b/.github/workflows/webapp.yml index 03c2d68..d9dd7b8 100644 --- a/.github/workflows/webapp.yml +++ b/.github/workflows/webapp.yml @@ -66,12 +66,30 @@ jobs: name: build path: build -# TODO: Generate test job config executing Jest: "npm run test" -# test: -# needs: [lint, build] -# runs-on: ubuntu-latest -# steps: -# ... + test: + needs: [lint, build] + runs-on: ubuntu-latest + steps: + - name: Checkout project + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: 'npm' + - name: Install dependencies + run: | + npm ci + - name: Download build artifact + uses: actions/download-artifact@v3 + with: + name: build + path: build + - name: Run tests + run: npm test + # TODO: Generate test E2E job config executing Cypress "npm run test:e2e" # e2e: @@ -83,7 +101,7 @@ jobs: deploy: # TODO: change when "test" & "e2e" jobs are ready! # needs: [test, e2e] - needs: [lint, build] + needs: [test] permissions: # needs branching/commit contents contents: write