Skip to content

Commit 7a77365

Browse files
authored
feat: change ios CI (#1831)
Added improved iOS CI jobs
1 parent 4062c2e commit 7a77365

File tree

2 files changed

+111
-32
lines changed

2 files changed

+111
-32
lines changed
Lines changed: 59 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,75 @@
11
name: Test iOS build
22
on:
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+
1213
jobs:
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

.github/workflows/macos-build-test.yml

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,75 @@ on:
44
branches:
55
- main
66
paths:
7+
- '.github/workflows/macos-build-test.yml'
8+
- 'RNSVG.podspec'
79
- 'apple/**'
10+
- 'Example/macos/**'
811
push:
912
branches:
1013
- main
1114
workflow_dispatch:
1215
jobs:
1316
build:
14-
runs-on: macos-latest
17+
runs-on: macos-12
1518
env:
1619
WORKING_DIRECTORY: Example
1720
concurrency:
1821
group: macos-${{ github.ref }}
19-
cancel-in-progress: true
2022
steps:
21-
- name: checkout
23+
- name: Check out Git repository
2224
uses: actions/checkout@v2
23-
- name: Use Node.js 14
24-
uses: actions/setup-node@v2
25+
26+
- name: Restore svg node_modules from cache
27+
uses: actions/cache@v2
28+
id: cache-node-modules-svg
2529
with:
26-
node-version: 14
27-
cache: 'yarn'
28-
cache-dependency-path: 'Example/yarn.lock'
29-
- name: Install node dependencies
30+
path: |
31+
node_modules
32+
key: ${{ runner.os }}-node-modules-svg-${{ hashFiles('yarn.lock') }}
33+
restore-keys: |
34+
${{ runner.os }}-node-modules-svg
35+
- name: Install svg dependencies
36+
run: yarn install --frozen-lockfile
37+
38+
- name: Restore app node_modules from cache
39+
uses: actions/cache@v2
40+
id: cache-node-modules-app
41+
with:
42+
path: |
43+
${{ env.WORKING_DIRECTORY }}/node_modules
44+
key: ${{ runner.os }}-node-modules-${{ env.WORKING_DIRECTORY }}-${{ hashFiles('${{ env.WORKING_DIRECTORY }}/yarn.lock') }}
45+
restore-keys: |
46+
${{ runner.os }}-node-modules-${{ env.WORKING_DIRECTORY }}-
47+
- name: Install app dependencies
3048
working-directory: ${{ env.WORKING_DIRECTORY }}
31-
run: yarn
32-
- name: Install pods
49+
run: yarn install --frozen-lockfile
50+
51+
- name: Restore Pods from cache
52+
uses: actions/cache@v2
53+
id: cache-pods
54+
with:
55+
path: |
56+
${{ env.WORKING_DIRECTORY }}/macos/Pods
57+
~/Library/Caches/CocoaPods
58+
~/.cocoapods
59+
key: ${{ runner.os }}-pods-${{ env.WORKING_DIRECTORY }}-${{ hashFiles('${{ env.WORKING_DIRECTORY }}/macos/Podfile.lock') }}
60+
restore-keys: |
61+
${{ runner.os }}-pods-${{ env.WORKING_DIRECTORY }}-
62+
- name: Install Pods
3363
working-directory: ${{ env.WORKING_DIRECTORY }}/macos
3464
run: pod install
65+
66+
- name: Restore build artifacts from cache
67+
uses: actions/cache@v2
68+
id: cache-build
69+
with:
70+
path: |
71+
${{ env.WORKING_DIRECTORY }}/macos/build
72+
~/Library/Developer/Xcode/DerivedData
73+
key: ${{ runner.os }}-build-${{ env.WORKING_DIRECTORY }}-${{ hashFiles('${{ env.WORKING_DIRECTORY }}/macos/Podfile.lock') }}
74+
restore-keys: |
75+
${{ runner.os }}-build-${{ env.WORKING_DIRECTORY }}-
3576
- name: Build app
3677
working-directory: ${{ env.WORKING_DIRECTORY }}
3778
run: yarn macos

0 commit comments

Comments
 (0)