-
-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (40 loc) · 1.37 KB
/
angular-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
42
43
44
45
46
47
48
49
50
51
name: Angular Tests
on:
push:
branches:
- '*' # Trigger on all branches
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 8
steps:
- name: Checkout code
uses: actions/checkout@v2 # This step checks out your repository's code
- name: Fetch develop branch
run: git fetch origin develop
- name: Check for changes in ./src
id: check_changes
run: |
git diff --quiet origin/develop -- ./src || echo "::set-output name=changes_detected::true"
- name: Skip if no changes in ./src
run: exit 1
if: steps.check_changes.outputs.changes_detected != 'true'
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20.x' # Updated Node.js version
- name: Install Angular CLI
run: yarn global add @angular/cli # Use Yarn to install Angular CLI
- name: Cache Yarn dependencies
uses: actions/cache@v2
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Clear Yarn Cache
run: yarn cache clean
- name: Install dependencies
run: yarn install # Use Yarn to install dependencies
- name: Run tests
run: yarn test-headless # Use Yarn to run tests