Skip to content

Commit

Permalink
gh-actions(ci): add unit test step
Browse files Browse the repository at this point in the history
  • Loading branch information
omermujtaba18 committed Sep 19, 2024
1 parent 771af8f commit ec89e8f
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,34 @@ jobs:

- name: Run e2e tests
run: npm run test:e2e

unit:
runs-on: ubuntu-latest

if: ${{ !startsWith(github.event.head_commit.message, 'docs') }}
needs: format # Ensures the format job completes before e2e job starts
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Cache Node modules
uses: actions/cache@v4
id: cache-node-modules
with:
path: |
node_modules
~/.npm
key: ${{ runner.os }}-node-modules-${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-${{ env.NODE_VERSION }}-
- name: Install dependencies
run: npm ci

- name: Run unit tests
run: npm run test

0 comments on commit ec89e8f

Please sign in to comment.