-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (41 loc) · 1.07 KB
/
unit-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Pipeline to run unit tests and build when PR is opened
name: Unit Tests and Build
run-name: Unit Tests and Build
on:
# We are only going to trigger this workflow using status check of a PR
# When a PR is opened, this workflow will be triggered and if the status check passes, the PR can be merged
pull_request:
types:
- opened
branches:
- main
workflow_dispatch:
jobs:
unit-tests:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "14"
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm run test
build:
name: Build Application
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "14"
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build