11name : Test iOS build
22on :
33 pull_request :
4- branches :
5- - main
64 paths :
5+ - ' .github/workflows/ios-build-test.yml'
6+ - ' RNSVG.podspec'
77 - ' apple/**'
8+ - ' Example/ios/**'
89 push :
910 branches :
1011 - main
11- workflow_dispatch :
12+
1213jobs :
1314 build :
14- runs-on : macos-latest
15- env :
16- WORKING_DIRECTORY : Example
15+ runs-on : macos-12
16+ strategy :
17+ matrix :
18+ working-directory : [Example]
1719 concurrency :
18- group : ios-${{ github.ref }}
19- cancel-in-progress : true
20+ group : ios-${{ matrix.working-directory }}-${{ github.ref }}
2021 steps :
21- - name : checkout
22+ - name : Check out Git repository
2223 uses : actions/checkout@v2
23- - name : Use Node.js 14
24- uses : actions/setup-node@v2
24+
25+ - name : Restore svg node_modules from cache
26+ uses : actions/cache@v2
27+ id : cache-node-modules-svg
28+ with :
29+ path : |
30+ node_modules
31+ key : ${{ runner.os }}-node-modules-svg-${{ hashFiles('yarn.lock') }}
32+ restore-keys : |
33+ ${{ runner.os }}-node-modules-svg
34+ - name : Install svg node_modules
35+ run : yarn install --frozen-lockfile
36+
37+ - name : Restore app node_modules from cache
38+ uses : actions/cache@v2
39+ id : cache-node-modules-app
2540 with :
26- node-version : 14
27- cache : ' yarn'
28- cache-dependency-path : ' Example/yarn.lock'
29- - name : Install node dependencies
30- working-directory : ${{ env.WORKING_DIRECTORY }}
31- run : yarn
32- - name : Install pods
33- working-directory : ${{ env.WORKING_DIRECTORY }}/ios
41+ path : |
42+ ${{ matrix.working-directory }}/node_modules
43+ key : ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/yarn.lock', matrix.working-directory)) }}
44+ restore-keys : |
45+ ${{ runner.os }}-node-modules-${{ matrix.working-directory }}-
46+ - name : Install app node_modules
47+ working-directory : ${{ matrix.working-directory }}
48+ run : yarn install --frozen-lockfile
49+
50+ - name : Restore Pods from cache
51+ uses : actions/cache@v2
52+ id : cache-pods
53+ with :
54+ path : |
55+ ${{ matrix.working-directory }}/ios/Pods
56+ ~/Library/Caches/CocoaPods
57+ ~/.cocoapods
58+ key : ${{ runner.os }}-pods3-${{ matrix.working-directory }}-${{ hashFiles('yarn.lock', format('{0}/yarn.lock', matrix.working-directory), format('{0}/ios/Podfile.lock', matrix.working-directory)) }}
59+
60+ - name : Install Pods
61+ working-directory : ${{ matrix.working-directory }}/ios
3462 run : pod install
63+
64+ - name : Restore build artifacts from cache
65+ uses : actions/cache@v2
66+ id : cache-build
67+ with :
68+ path : |
69+ ${{ matrix.working-directory }}/ios/build
70+ ~/Library/Developer/Xcode/DerivedData
71+ key : ${{ runner.os }}-build3-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/ios/Podfile.lock', matrix.working-directory)) }}
72+
3573 - name : Build app
36- working-directory : ${{ env.WORKING_DIRECTORY }}
37- run : yarn ios
74+ working-directory : ${{ matrix.working-directory }}
75+ run : npx react-native run- ios
0 commit comments