1
- name : CI
1
+ name : Default storage
2
2
on :
3
3
push :
4
4
branches :
5
5
- main
6
6
pull_request :
7
7
jobs :
8
- format :
9
- name : Format
8
+ changes :
9
+ name : report changed files
10
10
runs-on : ubuntu-latest
11
+ outputs :
12
+ changed : ${{ steps.filter.outputs.storage }}
11
13
steps :
12
- - name : Checkout
13
- uses : actions/checkout@v3
14
- - name : Set up Node.js
15
-
16
- with :
17
- node-version : 18.16.1
18
- cache : yarn
19
- - name : Install JS dependencies
20
- run : yarn
21
- - name : Format
22
- run : |
23
- yarn format
24
- git diff --exit-code
25
- review :
26
- name : Review
27
- runs-on : ubuntu-latest
28
- strategy :
29
- matrix :
30
- test-name : [lint, ts]
31
- workspace : [default-storage, api]
32
- steps :
33
- - name : Checkout
34
- uses : actions/checkout@v3
35
- - name : Set up Node.js
36
-
14
+ - uses : actions/checkout@v4
15
+ - uses : dorny/paths-filter@v3
16
+ id : filter
37
17
with :
38
- node-version : 18.16.1
39
- cache : yarn
40
- - name : Install JS dependencies
41
- run : yarn
42
- - name : Run test ${{ matrix.test-name }}
43
- run : yarn test:${{ matrix.test-name }}
44
- working-directory : packages/${{ matrix.workspace }}
18
+ token : ${{ secrets.GH_RELEASE_TOKEN }}
19
+ filters : |
20
+ storage:
21
+ - 'packages/default-storage/**'
22
+
45
23
android :
46
24
name : Android
25
+ needs : changes
26
+ if : ${{ needs.changes.outputs.changed == 'true' }}
47
27
runs-on : ubuntu-22.04
48
28
steps :
49
29
- name : Checkout
50
- uses : actions/checkout@v3
51
- - name : Set up Node.js
52
-
53
- with :
54
- node-version : 18.16.1
55
- cache : yarn
30
+ uses : actions/checkout@v4
31
+ - name : Setup project
32
+ uses : ./.github/actions/setup-project
56
33
- name : Install JS dependencies
57
34
run : |
58
35
yarn
@@ -69,21 +46,20 @@ jobs:
69
46
70
47
ios :
71
48
name : iOS
49
+ needs : changes
50
+ if : ${{ needs.changes.outputs.changed == 'true' }}
72
51
runs-on : macos-latest
73
52
steps :
74
53
- name : Checkout
75
- uses : actions/checkout@v3
54
+ uses : actions/checkout@v4
55
+ - name : Setup project
56
+ uses : ./.github/actions/setup-project
76
57
- name : Cache /.ccache
77
58
uses : actions/cache@v3
78
59
with :
79
60
path : packages/default-storage/.ccache
80
61
key : ccache-ios-${{ hashFiles('yarn.lock') }}
81
62
restore-keys : ccache-ios-
82
- - name : Set up Node.js
83
-
84
- with :
85
- node-version : 18.16.1
86
- cache : yarn
87
63
- name : Install JS dependencies
88
64
run : |
89
65
yarn
@@ -102,21 +78,20 @@ jobs:
102
78
103
79
macos :
104
80
name : macOS
81
+ needs : changes
82
+ if : ${{ needs.changes.outputs.changed == 'true' }}
105
83
runs-on : macos-latest
106
84
steps :
107
85
- name : Checkout
108
- uses : actions/checkout@v3
86
+ uses : actions/checkout@v4
87
+ - name : Setup project
88
+ uses : ./.github/actions/setup-project
109
89
- name : Cache /.ccache
110
90
uses : actions/cache@v3
111
91
with :
112
92
path : packages/default-storage/.ccache
113
93
key : ccache-macos-${{ hashFiles('yarn.lock') }}
114
94
restore-keys : ccache-macos-
115
- - name : Set up Node.js
116
-
117
- with :
118
- node-version : 18.16.1
119
- cache : yarn
120
95
- name : Install JS dependencies
121
96
run : |
122
97
yarn
@@ -140,19 +115,33 @@ jobs:
140
115
141
116
windows :
142
117
name : Windows
118
+ needs : changes
119
+ if : ${{ needs.changes.outputs.changed == 'true' }}
143
120
runs-on : windows-2022
144
121
steps :
122
+ - name : Checkout
123
+ uses : actions/checkout@v4
124
+ - name : Setup project
125
+ uses : ./.github/actions/setup-project
126
+ with :
127
+ windows-fix : true
128
+ - uses : actions/setup-node@v4
129
+ with :
130
+ node-version : ${{ inputs.node-version }}
131
+ cache : " yarn"
132
+ - name : Enable corepack
133
+ shell : bash
134
+ run : |
135
+ corepack enable
136
+ yarn --version
137
+ - uses : actions/setup-node@v4
138
+ with :
139
+ node-version : ${{ inputs.node-version }}
140
+ cache : " yarn"
145
141
- name : Set up MSBuild
146
142
147
143
- name : Setup VSTest.console.exe
148
144
149
- - name : Checkout
150
- uses : actions/checkout@v3
151
- - name : Set up Node.js
152
-
153
- with :
154
- node-version : 18.16.1
155
- cache : yarn
156
145
- name : Install JS dependencies
157
146
run : |
158
147
yarn
@@ -167,19 +156,16 @@ jobs:
167
156
168
157
release :
169
158
name : Release
170
- needs : [format, review, android, ios, macos, windows]
159
+ needs : [android, ios, macos, windows]
171
160
if : github.event_name == 'push'
172
161
runs-on : ubuntu-22.04
173
162
steps :
174
163
- name : Checkout
175
- uses : actions/checkout@v3
164
+ uses : actions/checkout@v4
176
165
with :
177
166
persist-credentials : false
178
- - name : Set up Node.js
179
-
180
- with :
181
- node-version : 18.16.1
182
- cache : yarn
167
+ - name : Setup project
168
+ uses : ./.github/actions/setup-project
183
169
- name : Install JS dependencies
184
170
run : |
185
171
yarn
0 commit comments