Browse Source

feat(ci) use a more future-proof way of installing Node in CI

Install the version based on .nvmrc rather than speficying it in the
action.
factor2
Saúl Ibarra Corretgé 1 year ago
parent
commit
3f943feb4a
1 changed files with 25 additions and 5 deletions
  1. 25
    5
      .github/workflows/ci.yml

+ 25
- 5
.github/workflows/ci.yml View File

@@ -10,8 +10,12 @@ jobs:
10 10
     - uses: actions/checkout@v4
11 11
     - uses: actions/setup-node@v4
12 12
       with:
13
-        node-version: 20
13
+        node-version-file: '.nvmrc'
14 14
         cache: 'npm'
15
+    - name: Check Node / npm versions
16
+      run: |
17
+        node -v
18
+        npm -v
15 19
     - name: Get changed files
16 20
       id: changed-files
17 21
       uses: tj-actions/changed-files@v41
@@ -37,8 +41,12 @@ jobs:
37 41
     - uses: actions/checkout@v4
38 42
     - uses: actions/setup-node@v4
39 43
       with:
40
-        node-version: 20
44
+        node-version-file: '.nvmrc'
41 45
         cache: 'npm'
46
+    - name: Check Node / npm versions
47
+      run: |
48
+        node -v
49
+        npm -v
42 50
     - run: npm install
43 51
     - run: make
44 52
   macos-ci:
@@ -59,8 +67,12 @@ jobs:
59 67
     - uses: actions/checkout@v4
60 68
     - uses: actions/setup-node@v4
61 69
       with:
62
-        node-version: 20
70
+        node-version-file: '.nvmrc'
63 71
         cache: 'npm'
72
+    - name: Check Node / npm versions
73
+      run: |
74
+        node -v
75
+        npm -v
64 76
     - run: npm install
65 77
     - run: npx react-native bundle --entry-file react/index.native.js --platform android --bundle-output /tmp/android.bundle --reset-cache
66 78
   ios-build:
@@ -74,8 +86,12 @@ jobs:
74 86
     - uses: actions/checkout@v4
75 87
     - uses: actions/setup-node@v4
76 88
       with:
77
-        node-version: 20
89
+        node-version-file: '.nvmrc'
78 90
         cache: 'npm'
91
+    - name: Check Node / npm versions
92
+      run: |
93
+        node -v
94
+        npm -v
79 95
     - run: npm install
80 96
     - name: setup Xcode
81 97
       run: |
@@ -102,8 +118,12 @@ jobs:
102 118
     - uses: actions/checkout@v4
103 119
     - uses: actions/setup-node@v4
104 120
       with:
105
-        node-version: 16
121
+        node-version-file: '.nvmrc'
106 122
         cache: 'npm'
123
+    - name: Check Node / npm versions
124
+      run: |
125
+        node -v
126
+        npm -v
107 127
     - run: npm install
108 128
     - run: make
109 129
     - run: sudo apt-get install -y debhelper

Loading…
Cancel
Save