-
Notifications
You must be signed in to change notification settings - Fork 3
40 lines (32 loc) · 999 Bytes
/
node-install.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
name: Conditional Dependency Installation
on: [push, pull_request]
jobs:
dependency_install:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '21'
- name: Set up Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Check Number of Dependencies in UI Directory
run: |
cd ./
DEP_COUNT=$(jq '.dependencies | length' package.json)
echo "Number of dependencies: $DEP_COUNT"
echo "DEPENDENCY_COUNT=$DEP_COUNT" >> $GITHUB_ENV
- name: Install Dependencies with NPM in UI Directory
if: ${{ env.DEPENDENCY_COUNT && env.DEPENDENCY_COUNT <= 20 }}
run: |
cd ./
npm install
- name: Install Dependencies with Bun in UI Directory
if: ${{ env.DEPENDENCY_COUNT && env.DEPENDENCY_COUNT > 20 }}
run: |
cd ./
bun install