1- name : CI
1+ name : Default storage
22on :
33 push :
44 branches :
55 - main
66 pull_request :
77jobs :
8- format :
9- name : Format
8+ changes :
9+ name : report changed files
1010 runs-on : ubuntu-latest
11+ outputs :
12+ changed : ${{ steps.filter.outputs.storage }}
1113 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
3717 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+
4523 android :
4624 name : Android
25+ needs : changes
26+ if : ${{ needs.changes.outputs.changed == 'true' }}
4727 runs-on : ubuntu-22.04
4828 steps :
4929 - 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
5633 - name : Install JS dependencies
5734 run : |
5835 yarn
@@ -69,21 +46,20 @@ jobs:
6946
7047 ios :
7148 name : iOS
49+ needs : changes
50+ if : ${{ needs.changes.outputs.changed == 'true' }}
7251 runs-on : macos-latest
7352 steps :
7453 - name : Checkout
75- uses : actions/checkout@v3
54+ uses : actions/checkout@v4
55+ - name : Setup project
56+ uses : ./.github/actions/setup-project
7657 - name : Cache /.ccache
7758 uses : actions/cache@v3
7859 with :
7960 path : packages/default-storage/.ccache
8061 key : ccache-ios-${{ hashFiles('yarn.lock') }}
8162 restore-keys : ccache-ios-
82- - name : Set up Node.js
83- 84- with :
85- node-version : 18.16.1
86- cache : yarn
8763 - name : Install JS dependencies
8864 run : |
8965 yarn
@@ -102,21 +78,20 @@ jobs:
10278
10379 macos :
10480 name : macOS
81+ needs : changes
82+ if : ${{ needs.changes.outputs.changed == 'true' }}
10583 runs-on : macos-latest
10684 steps :
10785 - name : Checkout
108- uses : actions/checkout@v3
86+ uses : actions/checkout@v4
87+ - name : Setup project
88+ uses : ./.github/actions/setup-project
10989 - name : Cache /.ccache
11090 uses : actions/cache@v3
11191 with :
11292 path : packages/default-storage/.ccache
11393 key : ccache-macos-${{ hashFiles('yarn.lock') }}
11494 restore-keys : ccache-macos-
115- - name : Set up Node.js
116- 117- with :
118- node-version : 18.16.1
119- cache : yarn
12095 - name : Install JS dependencies
12196 run : |
12297 yarn
@@ -140,19 +115,33 @@ jobs:
140115
141116 windows :
142117 name : Windows
118+ needs : changes
119+ if : ${{ needs.changes.outputs.changed == 'true' }}
143120 runs-on : windows-2022
144121 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"
145141 - name : Set up MSBuild
146142147143 - name : Setup VSTest.console.exe
148144149- - 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
156145 - name : Install JS dependencies
157146 run : |
158147 yarn
@@ -167,19 +156,16 @@ jobs:
167156
168157 release :
169158 name : Release
170- needs : [format, review, android, ios, macos, windows]
159+ needs : [android, ios, macos, windows]
171160 if : github.event_name == 'push'
172161 runs-on : ubuntu-22.04
173162 steps :
174163 - name : Checkout
175- uses : actions/checkout@v3
164+ uses : actions/checkout@v4
176165 with :
177166 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
183169 - name : Install JS dependencies
184170 run : |
185171 yarn
0 commit comments