-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 1.61 KB
/
frontend-ci.yml
File metadata and controls
36 lines (34 loc) · 1.61 KB
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
name: Frontend Pipeline
# the trigger - when pull request and push is created on those branches only
# the workflow only runs if the files inside
on:
push:
branches: [main, dev]
paths:
- 'apps/frontend/**'
pull_request:
paths:
- 'apps/frontend/**'
jobs:
# this is only for frontend check only and provide job access to the code in the repo
# ubuntu latest - Github will uses linux machine - better and minimize build minutes
frontend-check:
runs-on: ubuntu-latest
steps:
# Note here: check if we use checkout@sha - that was in lecture slides not v4 (could be more secure)
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '24' #node 20 will be deprecated
# uses yarn NOT npm to store downloaded dependencies, dependency-path: means rebuild cache only if yarn.lock changes
cache: 'yarn'
cache-dependency-path: apps/frontend/client/yarn.lock
- name: Install & Test (Yarn)
# install all dependencies - Angular and builds node_modules
# frozen--lockfile -> prevent changes to lockfile and this installs all packages
# watch=false and --browser -> runs tests in chrome without opening a visible browser window
run: |
cd apps/frontend/client
yarn install --frozen-lockfile
yarn test --watch=false --browsers=ChromeHeadless