-
-
Notifications
You must be signed in to change notification settings - Fork 54
164 lines (159 loc) · 5.98 KB
/
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: iOS-E2E
on:
push:
branches:
- 'main'
pull_request:
defaults:
run:
shell: bash
concurrency:
# Group by workflow and ref, limit to 1 for pull requests
group: ${{ github.workflow }}-${{ github.ref }}-${{ startsWith(github.ref, 'refs/pull/') || github.run_number }}
# Cancel intermediate pull request builds
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
env:
SPRING_DOCKER_COMPOSE_ENABLED: false
jobs:
check-dependencies:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.pull_request.title, '[skip ci]') && !contains(github.event.pull_request.title, '[ci skip]') && !contains(github.event.ref_type, '[tag]')"
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: check-dependencies
run: |
cd generators/react-native/resources/expo
npm run check-dependencies
env:
EXPO_OFFLINE: 1
build-matrix:
runs-on: ubuntu-latest
needs: [check-dependencies]
outputs:
matrix: ${{ steps.build.outputs.matrix }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- id: build
run: |
npm ci --ignore-scripts --omit=dev
cli/cli.cjs github-build-matrix ios
applications:
name: ${{ matrix.sample }}
runs-on: ${{ matrix.os }}
needs: build-matrix
timeout-minutes: 90
defaults:
run:
working-directory: ${{ github.workspace }}/client
strategy:
fail-fast: false
matrix: ${{fromJson(needs.build-matrix.outputs.matrix)}}
env:
FORCE_COLOR: true
steps:
- uses: jhipster/actions/create-app-path@v0
with:
path: client
- uses: jhipster/actions/create-app-path@v0
with:
path: backend
- uses: jhipster/actions/setup-runner@v0
with:
node-version: ${{ matrix.node-version }}
java-version: ${{ matrix.java-version }}
maven-cache: true
binary-dir: ${{ github.workspace }}/generator-jhipster-react-native/cli
- uses: actions/checkout@v4
with:
path: generator-jhipster-react-native
fetch-depth: 2
- run: npm install
working-directory: ${{ github.workspace }}/generator-jhipster-react-native
- run: cli.cjs generate-sample ${{ matrix.sample }} --force --skip-commit-hook
working-directory: ${{ github.workspace }}/backend
- uses: jhipster/actions/compare-sample@v0
id: compare-backend
if: >-
github.event.pull_request &&
contains(github.event.pull_request.labels.*.name, 'pr: compare-backend')
with:
application-base-path: ${{ github.workspace }}/backend-base
application-folder: backend
compare-folder: backend
generator-path: generator-jhipster-react-native
cmd: cli.cjs generate-sample ${{ matrix.sample }} --force --skip-git --skip-commit-hook
- uses: jhipster/actions/compare-sample@v0
id: compare
if: >-
github.event.pull_request &&
!contains(github.event.pull_request.labels.*.name, 'pr: disable-compare') &&
steps.compare-backend.outputs.has-changes != 'true'
with:
application-folder: backend
compare-folder: client
generator-path: generator-jhipster-react-native
cmd: cli.cjs generate-sample ${{ matrix.sample }} --force --skip-git --skip-commit-hook
- uses: nick-invision/[email protected]
name: 'TOOLS: installing applesimutils'
if: steps.compare.outputs.equals != 'true'
with:
max_attempts: 3
timeout_minutes: 60
command: brew tap wix/brew && brew install applesimutils && applesimutils --list
retry_wait_seconds: 15
- uses: douglascamata/setup-docker-macos-action@8d5fa43892aed7eee4effcdea113fd53e4d4bf83
if: matrix.default-environment == 'prod' && steps.compare.outputs.equals != 'true'
timeout-minutes: 10
- run: npm run services:up
if: matrix.default-environment == 'prod' && steps.compare.outputs.equals != 'true'
working-directory: ${{ github.workspace }}/backend
- run: npm install
if: steps.compare.outputs.equals != 'true'
- run: npx expo prebuild -p ios
if: steps.compare.outputs.equals != 'true'
- run: npm run e2e:build:ios
if: steps.compare.outputs.equals != 'true'
- run: |
npm run app:start &
npm install -g wait-on
wait-on -t 60000 http-get://127.0.0.1:8080/management/health
if: steps.compare.outputs.equals != 'true' && matrix.skip-e2e != 'true'
working-directory: ${{ github.workspace }}/backend
- run: npm run e2e:test:ios
timeout-minutes: 15
env:
DETOX_RECORD_VIDEOS: "${{ contains(github.event.pull_request.labels.*.name, 'pr: record-videos') && 'all' || 'none' }}"
if: steps.compare.outputs.equals != 'true' && matrix.skip-e2e != 'true'
- uses: actions/upload-artifact@v4
if: steps.compare.outputs.equals != 'true' && always()
with:
name: expo-app-${{ matrix.sample }}
path: |
${{ github.workspace }}/client/
!${{ github.workspace }}/**/android
!${{ github.workspace }}/**/ios
!${{ github.workspace }}/**/node_modules
ios-result:
permissions:
contents: none
runs-on: ubuntu-latest
needs: [applications]
if: always()
steps:
- run: |
echo '${{ toJSON(needs) }}'
if ([ 'skipped' == '${{ needs.applications.result }}' ] || [ 'success' == '${{ needs.applications.result }}' ]); then
exit 0
fi
if [ 'closed' == '${{ github.event.action }}' ]; then
exit 0
fi
exit 1