Skip to content

Unit Tests and Build #18

Unit Tests and Build

Unit Tests and Build #18

Workflow file for this run

# ⁠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
# reopened is used to trigger the workflow when a PR is reopened
# When a new commit is pushed to the PR while it is opened the workflow will not be triggered
# The PR has to be reopened for the workflow to be triggered
- reopened
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:
needs: unit-tests
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