浏览代码

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年前
父节点
当前提交
3f943feb4a
共有 1 个文件被更改,包括 25 次插入5 次删除
  1. 25
    5
      .github/workflows/ci.yml

+ 25
- 5
.github/workflows/ci.yml 查看文件

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

正在加载...
取消
保存