|
| 1 | +--- |
1 | 2 | name: ci
|
2 | 3 | on:
|
3 | 4 | push:
|
4 |
| - branches: [ master ] |
| 5 | + branches: |
| 6 | + - master |
5 | 7 | pull_request:
|
6 |
| - branches: [ '**' ] |
| 8 | + branches: |
| 9 | + - "**" |
7 | 10 | env:
|
8 |
| - CI_XCODE_11: '/Applications/Xcode_11.7.app/Contents/Developer' |
9 |
| - CI_XCODE_13: '/Applications/Xcode_13.4.1.app/Contents/Developer' |
10 |
| - |
| 11 | + CI_XCODE_11: /Applications/Xcode_11.7.app/Contents/Developer |
| 12 | + CI_XCODE_14: /Applications/Xcode_14.2.app/Contents/Developer |
11 | 13 | jobs:
|
12 |
| - ios: |
13 |
| - runs-on: macos-12 |
14 |
| - steps: |
15 |
| - - uses: actions/checkout@v2 |
16 |
| - - name: Setup Ruby |
17 |
| - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108 |
18 |
| - - name: Cache Gems |
19 |
| - id: cache-gems |
20 |
| - uses: actions/cache@v2 |
21 |
| - with: |
22 |
| - path: vendor/bundle |
23 |
| - key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} |
24 |
| - restore-keys: | |
25 |
| - ${{ runner.os }}-gem- |
26 |
| - - name: Submodules and Bundle Install |
27 |
| - run: | |
28 |
| - git submodule update --init --recursive |
29 |
| - sudo gem install bundler |
30 |
| - bundle config set path 'vendor/bundle' |
31 |
| - bundle install |
32 |
| - - name: Build-Test |
33 |
| - run: set -o pipefail && env NSUnbufferedIO=YES bundle exec rake test:ios |
34 |
| - env: |
35 |
| - DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} |
36 |
| - - name: Send codecov |
37 |
| - run: bash <(curl https://codecov.io/bash) |
38 |
| - |
39 |
| - macos: |
40 |
| - runs-on: macos-latest |
41 |
| - steps: |
42 |
| - - uses: actions/checkout@v2 |
43 |
| - - name: Setup Ruby |
44 |
| - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108 |
45 |
| - - name: Cache Gems |
46 |
| - id: cache-gems |
47 |
| - uses: actions/cache@v2 |
48 |
| - with: |
49 |
| - path: vendor/bundle |
50 |
| - key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} |
51 |
| - restore-keys: | |
52 |
| - ${{ runner.os }}-gem- |
53 |
| - - name: Submodules and Bundle Install |
54 |
| - run: | |
55 |
| - git submodule update --init --recursive |
56 |
| - sudo gem install bundler |
57 |
| - bundle config set path 'vendor/bundle' |
58 |
| - bundle install |
59 |
| - - name: Create and set the default keychain |
60 |
| - run: | |
61 |
| - security create-keychain -p "" temporary |
62 |
| - security default-keychain -s temporary |
63 |
| - security unlock-keychain -p "" temporary |
64 |
| - security set-keychain-settings -lut 7200 temporary |
65 |
| - - name: Build-Test |
66 |
| - run: set -o pipefail && env NSUnbufferedIO=YES bundle exec rake test:macos |
67 |
| - env: |
68 |
| - DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} |
69 |
| - - name: Send codecov |
70 |
| - run: bash <(curl https://codecov.io/bash) |
71 |
| - |
72 |
| - facebook_utils: |
73 |
| - needs: parseui |
74 |
| - runs-on: macos-latest |
75 |
| - env: |
76 |
| - GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
77 |
| - steps: |
78 |
| - - uses: actions/checkout@v2 |
79 |
| - - name: Setup Ruby |
80 |
| - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108 |
81 |
| - - name: Cache Gems |
82 |
| - id: cache-gems |
83 |
| - uses: actions/cache@v2 |
84 |
| - with: |
85 |
| - path: vendor/bundle |
86 |
| - key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} |
87 |
| - restore-keys: | |
88 |
| - ${{ runner.os }}-gem- |
89 |
| - - name: Submodules and Bundle Install |
90 |
| - run: | |
91 |
| - git submodule update --init --recursive |
92 |
| - sudo gem install bundler |
93 |
| - bundle config set path 'vendor/bundle' |
94 |
| - bundle install |
95 |
| - carthage bootstrap --use-xcframeworks |
96 |
| - - name: Build-Test |
97 |
| - run: set -o pipefail && env NSUnbufferedIO=YES bundle exec rake test:facebook_utils:ios |
98 |
| - env: |
99 |
| - DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} |
100 |
| - - name: Send codecov |
101 |
| - run: bash <(curl https://codecov.io/bash) |
102 |
| - |
103 |
| - twitter_utils: |
104 |
| - needs: parseui |
105 |
| - runs-on: macos-latest |
106 |
| - steps: |
107 |
| - - uses: actions/checkout@v2 |
108 |
| - - name: Setup Ruby |
109 |
| - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108 |
110 |
| - - name: Cache Gems |
111 |
| - id: cache-gems |
112 |
| - uses: actions/cache@v2 |
113 |
| - with: |
114 |
| - path: vendor/bundle |
115 |
| - key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} |
116 |
| - restore-keys: | |
117 |
| - ${{ runner.os }}-gem- |
118 |
| - - name: Submodules and Bundle Install |
119 |
| - run: | |
120 |
| - git submodule update --init --recursive |
121 |
| - sudo gem install bundler |
122 |
| - bundle config set path 'vendor/bundle' |
123 |
| - bundle install |
124 |
| - - name: Build-Test |
125 |
| - run: set -o pipefail && env NSUnbufferedIO=YES bundle exec rake test:twitter_utils:ios |
126 |
| - env: |
127 |
| - DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} |
128 |
| - - name: Send codecov |
129 |
| - run: bash <(curl https://codecov.io/bash) |
130 |
| - |
131 |
| - parseui: |
132 |
| - runs-on: macos-latest |
133 |
| - env: |
134 |
| - GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
135 |
| - steps: |
136 |
| - - uses: actions/checkout@v2 |
137 |
| - - name: Setup Ruby |
138 |
| - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108 |
139 |
| - - name: Cache Gems |
140 |
| - id: cache-gems |
141 |
| - uses: actions/cache@v2 |
142 |
| - with: |
143 |
| - path: vendor/bundle |
144 |
| - key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} |
145 |
| - restore-keys: | |
146 |
| - ${{ runner.os }}-gem- |
147 |
| - - name: Submodules and Bundle Install |
148 |
| - run: | |
149 |
| - git submodule update --init --recursive |
150 |
| - sudo gem install bundler |
151 |
| - bundle config set path 'vendor/bundle' |
152 |
| - bundle install |
153 |
| - carthage bootstrap --use-xcframeworks |
154 |
| - - name: Build-Test |
155 |
| - env: |
156 |
| - DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} |
157 |
| - run: set -o pipefail && env NSUnbufferedIO=YES bundle exec rake test:parseui:all |
158 |
| - - name: Send codecov |
159 |
| - run: bash <(curl https://codecov.io/bash) |
160 |
| - |
161 |
| - parse_live_query: |
162 |
| - runs-on: macos-latest |
163 |
| - env: |
164 |
| - GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
165 |
| - steps: |
166 |
| - - uses: actions/checkout@v2 |
167 |
| - - name: Setup Ruby |
168 |
| - uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108 |
169 |
| - - name: Cache Gems |
170 |
| - id: cache-gems |
171 |
| - uses: actions/cache@v2 |
172 |
| - with: |
173 |
| - path: vendor/bundle |
174 |
| - key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} |
175 |
| - restore-keys: | |
176 |
| - ${{ runner.os }}-gem- |
177 |
| - - name: Submodules and Bundle Install |
178 |
| - run: | |
179 |
| - git submodule update --init --recursive |
180 |
| - sudo gem install bundler |
181 |
| - bundle config set path 'vendor/bundle' |
182 |
| - bundle install |
183 |
| - carthage bootstrap --use-xcframeworks |
184 |
| - - name: Build-Test |
185 |
| - run: set -o pipefail && env NSUnbufferedIO=YES bundle exec rake test:parse_live_query:all |
186 |
| - env: |
187 |
| - DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} |
188 |
| - - name: Send codecov |
189 |
| - run: bash <(curl https://codecov.io/bash) |
190 |
| - |
191 |
| - assets: |
192 |
| - runs-on: macos-11 |
| 14 | + tests: |
193 | 15 | env:
|
194 | 16 | GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
| 17 | + timeout-minutes: 60 |
| 18 | + strategy: |
| 19 | + matrix: |
| 20 | + script: |
| 21 | + - test:ios |
| 22 | + - test:macos |
| 23 | + - test:facebook_utils:ios |
| 24 | + - test:twitter_utils:ios |
| 25 | + - test:parseui:all |
| 26 | + - test:parse_live_query:all |
| 27 | + - package:release |
| 28 | + fail-fast: false |
| 29 | + runs-on: ${{ (matrix.script == 'package:release' && 'macos-11') || 'macos-12' }} |
195 | 30 | steps:
|
196 |
| - - uses: actions/checkout@v2 |
| 31 | + - uses: actions/checkout@v3 |
197 | 32 | - name: Setup Ruby
|
198 | 33 | uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
|
199 | 34 | - name: Cache Gems
|
200 | 35 | id: cache-gems
|
201 |
| - uses: actions/cache@v2 |
| 36 | + uses: actions/cache@v3 |
202 | 37 | with:
|
203 | 38 | path: vendor/bundle
|
204 | 39 | key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
205 | 40 | restore-keys: |
|
206 | 41 | ${{ runner.os }}-gem-
|
207 |
| - - name: Submodules and Bundle Install |
| 42 | + - name: Create and set the default keychain |
| 43 | + run: | |
| 44 | + security create-keychain -p "" temporary |
| 45 | + security default-keychain -s temporary |
| 46 | + security unlock-keychain -p "" temporary |
| 47 | + security set-keychain-settings -lut 7200 temporary |
| 48 | + - name: Submodules |
208 | 49 | run: |
|
209 | 50 | git submodule update --init --recursive
|
210 | 51 | sudo gem install bundler
|
211 | 52 | bundle config set path 'vendor/bundle'
|
212 |
| - bundle install |
| 53 | + - name: Bundle Install |
| 54 | + if: steps.cache-gems.outputs.cache-hit != 'true' |
| 55 | + run: bundle install |
| 56 | + - name: Cache Carthage |
| 57 | + uses: actions/cache@v3 |
| 58 | + id: carthage-cache |
| 59 | + with: |
| 60 | + path: Carthage |
| 61 | + key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }} |
| 62 | + restore-keys: | |
| 63 | + ${{ runner.os }}-carthage- |
| 64 | + - name: Carthage |
| 65 | + if: ${{ steps.carthage-cache.outputs.cache-hit != 'true' }} |
| 66 | + run: | |
213 | 67 | carthage bootstrap --use-xcframeworks
|
214 |
| - - name: Build Release |
215 |
| - run: set -o pipefail && env NSUnbufferedIO=YES bundle exec rake package:release |
| 68 | + - name: Build-Test |
| 69 | + run: set -o pipefail && env NSUnbufferedIO=YES bundle exec rake ${{ matrix.script }} |
216 | 70 | env:
|
217 |
| - DEVELOPER_DIR: ${{ env.CI_XCODE_11 }} |
218 |
| - |
| 71 | + DEVELOPER_DIR: ${{ (matrix.script == 'package:release' && env.CI_XCODE_11) || env.CI_XCODE_14 }} |
| 72 | + - name: Generate Environment Variables |
| 73 | + if: ${{ always() }} |
| 74 | + env: |
| 75 | + ARTIFACT_NAME: ${{ matrix.script }}-logs |
| 76 | + TEST_RESULTS: ${{ matrix.script }}.xcresult |
| 77 | + run: | |
| 78 | + ARTIFACT_NAME=${{ env.ARTIFACT_NAME }} |
| 79 | + TEST_RESULTS=$(find ~/Library/Developer/Xcode/DerivedData -name "*.xcresult") |
| 80 | + echo ARTIFACT_NAME=${ARTIFACT_NAME//:/-} >> $GITHUB_ENV # replace colon with dashes |
| 81 | + echo TEST_RESULTS=${TEST_RESULTS} >> $GITHUB_ENV |
| 82 | + echo "Artifact Name: $ARTIFACT_NAME" |
| 83 | + echo "Test Result Location: $TEST_RESULTS" |
| 84 | + - name: Upload Artifact Logs |
| 85 | + if: ${{ failure() }} |
| 86 | + uses: actions/upload-artifact@v3 |
| 87 | + with: |
| 88 | + name: ${{ env.ARTIFACT_NAME }} |
| 89 | + path: | |
| 90 | + ~/Library/Developer/Xcode/DerivedData/Parse-*/Logs/Test |
| 91 | + - name: Upload Coverage |
| 92 | + |
| 93 | + with: |
| 94 | + xcode: true |
| 95 | + xcode_archive_path: ${{ env.TEST_RESULTS }} |
219 | 96 | docs:
|
220 |
| - needs: parseui |
221 |
| - runs-on: macos-latest |
| 97 | + runs-on: macos-12 |
222 | 98 | steps:
|
223 |
| - - uses: actions/checkout@v2 |
| 99 | + - uses: actions/checkout@v3 |
224 | 100 | - name: Setup Ruby
|
225 | 101 | uses: ruby/setup-ruby@359bebbc29cbe6c87da6bc9ea3bc930432750108
|
226 | 102 | - name: Cache Gems
|
227 | 103 | id: cache-gems
|
228 |
| - uses: actions/cache@v2 |
| 104 | + uses: actions/cache@v3 |
229 | 105 | with:
|
230 | 106 | path: vendor/bundle
|
231 | 107 | key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
232 | 108 | restore-keys: |
|
233 | 109 | ${{ runner.os }}-gem-
|
234 |
| - - name: Submodules and Bundle Instal |
| 110 | + - name: Submodules |
235 | 111 | run: |
|
236 | 112 | git submodule update --init --recursive
|
237 | 113 | sudo gem install bundler
|
238 | 114 | bundle config path vendor/bundle
|
239 |
| - bundle install |
| 115 | + - name: Bundle Install |
| 116 | + if: steps.cache-gems.outputs.cache-hit != 'true' |
| 117 | + run: bundle install |
240 | 118 | - name: Create Jazzy Docs
|
241 | 119 | run: |
|
242 | 120 | ./Scripts/jazzy.sh
|
243 | 121 | env:
|
244 |
| - DEVELOPER_DIR: ${{ env.CI_XCODE_13 }} |
| 122 | + DEVELOPER_DIR: ${{ env.CI_XCODE_14 }} |
0 commit comments