-
Notifications
You must be signed in to change notification settings - Fork 485
156 lines (149 loc) · 4.26 KB
/
pull-request.yml
File metadata and controls
156 lines (149 loc) · 4.26 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: PR review
on:
pull_request:
jobs:
code-quality:
name: Code quality
runs-on: ubuntu-latest
strategy:
matrix:
test-name: [lint, ts, format]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup project
uses: ./.github/actions/setup-project
- name: Install dependencies
run: yarn
- name: Build async-storage js
run: yarn build:js
- name: test ${{ matrix.test-name }}
run: yarn test:${{ matrix.test-name }}
shared-storage-tests:
name: shared-storage tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-24.04]
testName: [testAndroidHostTest, macosArm64Test, iosSimulatorArm64Test]
exclude:
- testName: testAndroidHostTest
os: macos-latest
- testName: macosArm64Test
os: ubuntu-24.04
- testName: iosSimulatorArm64Test
os: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: actions/setup-java@v5
with:
distribution: "temurin"
java-version: "21"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Run test ${{ matrix.testName }}
run: |
./gradlew ${{ matrix.testName }}
changes:
name: report changed files
runs-on: ubuntu-latest
needs:
- code-quality
- shared-storage-tests
outputs:
changed: ${{ steps.filter.outputs.storage }}
steps:
- uses: actions/checkout@v5
- uses: dorny/paths-filter@v3
id: filter
with:
token: ${{ secrets.GH_RELEASE_TOKEN }}
filters: |
storage:
- 'packages/async-storage/**'
android:
name: Android RN
needs: changes
if: ${{ needs.changes.outputs.changed == 'true' }}
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup project
uses: ./.github/actions/setup-project
- name: Install JS dependencies
run: yarn
- name: Build async-storage js
run: yarn build:js
- name: Bundle JS
run: yarn bundle:android
working-directory: examples/react-native
ios:
name: iOS RN
needs: changes
if: ${{ needs.changes.outputs.changed == 'true' }}
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup project
uses: ./.github/actions/setup-project
- name: Cache /.ccache
uses: actions/cache@v3
with:
path: packages/async-storage/.ccache
key: ccache-ios-${{ hashFiles('yarn.lock') }}
restore-keys: ccache-ios-
- name: Install JS dependencies
run: yarn
- name: Build async-storage js
run: yarn build:js
- name: Bundle JS
run: yarn bundle:ios
working-directory: examples/react-native
macOS:
name: macOS RN
needs: changes
if: ${{ needs.changes.outputs.changed == 'true' }}
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup project
uses: ./.github/actions/setup-project
- name: Cache /.ccache
uses: actions/cache@v3
with:
path: packages/async-storage/.ccache
key: ccache-ios-${{ hashFiles('yarn.lock') }}
restore-keys: ccache-ios-
- name: Install JS dependencies
run: yarn
- name: Build async-storage js
run: yarn build:js
- name: Bundle JS
run: yarn bundle:macos
working-directory: examples/react-native
windows:
name: Windows RN
needs: changes
if: ${{ needs.changes.outputs.changed == 'true' }}
runs-on: windows-2022
steps:
- name: Set up MSBuild
uses: microsoft/setup-msbuild@v1.3
- name: Setup VSTest.console.exe
uses: darenm/Setup-VSTest@v1.2
- name: Checkout
uses: actions/checkout@v5
- name: Setup project
uses: ./.github/actions/setup-project
with:
windows-fix: true
- name: Install JS dependencies
run: yarn
- name: Build async-storage js
run: yarn build:js
- name: Bundle JS
run: yarn bundle:windows
working-directory: examples/react-native