Skip to content

Commit c3a7b50

Browse files
authored
chore: cocoapods cache and cancel previous (#366)
1 parent 9bba811 commit c3a7b50

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ on:
66
branches: [ master ]
77
workflow_dispatch:
88
jobs:
9+
cancel_previous:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: styfle/[email protected]
13+
with:
14+
workflow_id: ${{ github.event.workflow.id }}
915
build-and-test:
16+
needs: cancel_previous
1017
runs-on: 'ubuntu-latest'
1118
steps:
1219
- uses: actions/checkout@v2
@@ -29,33 +36,51 @@ jobs:
2936
run: yarn build:plugins
3037

3138
run-e2e-ios:
39+
needs: cancel_previous
3240
runs-on: 'macos-11'
3341
steps:
3442
- uses: actions/checkout@v2
43+
3544
- uses: actions/setup-node@v2
3645
with:
3746
node-version: '14'
3847
cache: 'yarn'
48+
3949
- uses: maxim-lobanov/setup-xcode@v1
4050
with:
4151
xcode-version: 12.5.1
52+
53+
- name: Cocoapods cache
54+
uses: actions/cache@v2
55+
with:
56+
path: ./example/ios/Pods
57+
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
58+
restore-keys: |
59+
${{ runner.os }}-pods-
60+
4261
- name: Install applesimutils
4362
run: |
4463
HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null
4564
HOMEBREW_NO_AUTO_UPDATE=1 brew install applesimutils >/dev/null
4665
- run: yarn install
47-
- run: yarn bootstrap
66+
67+
- name: Bootstrap
68+
run: yarn bootstrap
69+
4870
- name: Run Server (with mocks)
4971
run: yarn example start:e2e &
72+
5073
- name: Detox - Build
5174
run: yarn example e2e:build:ios
75+
5276
- name: Detox - Test
5377
run: |
5478
yarn example detox clean-framework-cache
5579
yarn example detox build-framework-cache
5680
yarn example e2e:test:ios
5781
5882
run-e2e-android:
83+
needs: cancel_previous
5984
runs-on: 'macos-11' # This is important, linux cannot run the emulator graphically for e2e tests
6085
strategy:
6186
matrix:
@@ -103,7 +128,8 @@ jobs:
103128
node-version: '14'
104129
cache: 'yarn'
105130

106-
- run: yarn example && yarn # No need to run bootstrap here since we don't need cocoapods
131+
- name: Bootstrap
132+
run: yarn example && yarn # No need to run bootstrap here since we don't need cocoapods
107133
- name: Run Server (with mocks)
108134
run: yarn example start:e2e &
109135
- name: Detox - Build

0 commit comments

Comments
 (0)