-
Notifications
You must be signed in to change notification settings - Fork 25
98 lines (84 loc) · 3.25 KB
/
build-ios.yml
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
name: iOS build
on:
pull_request:
paths:
- 'package/ios/**'
- 'package/cpp/**'
- 'package/example/package.json'
- '.github/workflows/**'
push:
branches:
- main
jobs:
build:
runs-on: macos-12
strategy:
matrix:
working-directory: [package/example]
concurrency:
group: ios-example-${{ matrix.working-directory }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: 'yarn'
cache-dependency-path: package/yarn.lock
- name: Install Package
run: cd package; yarn install --frozen-lockfile
- name: Download Dawn Binary Artifacts
uses: dawidd6/action-download-artifact@v2
with:
workflow: "build-dawn.yml"
repo: wcandillon/react-native-webgpu
path: artifacts
branch: main
- name: Copy Artifacts to libs folder
working-directory: package
run: yarn copy-artifacts
- name: Restore Pods from cache
uses: actions/cache@v3
with:
path: |
${{ matrix.working-directory }}/ios/Pods
~/Library/Caches/CocoaPods
~/.cocoapods
key: ${{ runner.os }}-pods-${{ matrix.working-directory }}-${{ hashFiles(format('{0}/ios/Podfile.lock', matrix.working-directory)) }}
- name: Install Pods
working-directory: ${{ matrix.working-directory }}/ios
run: pod install
- name: Check if Podfile.lock has changed
working-directory: ${{ matrix.working-directory }}/ios
run: |
# Use git diff to get differences, excluding lines for 'COCOAPODS:' and filtering out 'React-RCTAppDelegate:'
# Right now we also exclude changes to React-RCTAppDelegate because of
# https://github.com/facebook/react-native/issues/39971
if git diff --ignore-all-space -I 'COCOAPODS:' -I "React-RCTAppDelegate" HEAD -- example/ios/Podfile.lock | grep -q .; then
echo "Podfile.lock has local changes, please update it."
# Display diff, but exclude 'React-RCTAppDelegate:' changes for clarity
git diff --ignore-all-space -I 'COCOAPODS:' -I "React-RCTAppDelegate" HEAD -- example/ios/Podfile.lock | grep -q .;
exit 1
else
echo "Podfile.lock is up to date."
fi
- name: Restore build artifacts from cache
uses: actions/cache@v3
with:
path: ~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-ios-derived-data-${{ hashFiles(format('{0}/ios/Podfile.lock', matrix.working-directory)) }}
- name: Build app
working-directory: ${{ matrix.working-directory }}
run: CI=true yarn ios --simulator 'iPhone 14 Pro'
# - name: Run e2e tests
# working-directory: package
# run: yarn e2e
# - name: Start package manager
# working-directory: example
# run: E2E=true yarn start &
# - name: Take screenshot
# run: xcrun simctl io booted screenshot screenshot.png
# - uses: actions/upload-artifact@v2
# with:
# path: screenshot.png
# name: Download-screenshots