-
Notifications
You must be signed in to change notification settings - Fork 433
140 lines (127 loc) · 4.3 KB
/
scripts-ios-native.yml
File metadata and controls
140 lines (127 loc) · 4.3 KB
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
name: Test iOS native test scripts
on:
pull_request:
paths:
- '.github/workflows/scripts-ios-native.yml'
- 'scripts/setup-workspace.sh'
- 'scripts/build-ios-port.sh'
- 'scripts/build-ios-app.sh'
- 'scripts/run-ios-native-tests.sh'
- 'scripts/ios/create-shared-scheme.py'
- 'scripts/ios/notification-tests/native-tests/**'
- 'scripts/ios/notification-tests/install-native-notification-tests.sh'
- 'scripts/ios/notification-tests/**'
- 'scripts/hellocodenameone/**'
- 'scripts/templates/**'
- '!scripts/templates/**/*.md'
- 'CodenameOne/src/**'
- '!CodenameOne/src/**/*.md'
- 'Ports/iOSPort/**'
- '!Ports/iOSPort/**/*.md'
- 'vm/**'
- '!vm/**/*.md'
- 'tests/**'
- '!tests/**/*.md'
- '!docs/**'
- 'maven/**'
- '!maven/core-unittests/**'
push:
branches: [ master ]
paths:
- '.github/workflows/scripts-ios-native.yml'
- 'scripts/setup-workspace.sh'
- 'scripts/build-ios-port.sh'
- 'scripts/build-ios-app.sh'
- 'scripts/run-ios-native-tests.sh'
- 'scripts/ios/create-shared-scheme.py'
- 'scripts/ios/notification-tests/native-tests/**'
- 'scripts/ios/notification-tests/install-native-notification-tests.sh'
- 'scripts/ios/notification-tests/**'
- 'scripts/hellocodenameone/**'
- 'scripts/templates/**'
- '!scripts/templates/**/*.md'
- 'CodenameOne/src/**'
- '!CodenameOne/src/**/*.md'
- 'Ports/iOSPort/**'
- '!Ports/iOSPort/**/*.md'
- 'vm/**'
- '!vm/**/*.md'
- 'tests/**'
- '!tests/**/*.md'
- '!docs/**'
- 'maven/**'
- '!maven/core-unittests/**'
jobs:
native-ios:
permissions:
contents: read
runs-on: macos-15
timeout-minutes: 65
concurrency:
group: mac-ci-${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- name: Ensure CocoaPods tooling
run: |
mkdir -p ~/.codenameone
cp maven/UpdateCodenameOne.jar ~/.codenameone/
set -euo pipefail
if ! command -v ruby >/dev/null; then
echo "ruby not found"; exit 1
fi
GEM_USER_DIR="$(ruby -e 'print Gem.user_dir')"
export PATH="$GEM_USER_DIR/bin:$PATH"
gem install cocoapods xcodeproj --no-document --user-install
pod --version
- name: Compute setup-workspace hash
id: setup_hash
run: |
set -euo pipefail
echo "hash=$(shasum -a 256 scripts/setup-workspace.sh | awk '{print $1}')" >> "$GITHUB_OUTPUT"
- name: Set TMPDIR
run: echo "TMPDIR=${{ runner.temp }}" >> $GITHUB_ENV
- name: Cache codenameone-tools
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/codenameone-tools
key: ${{ runner.os }}-cn1-tools-${{ steps.setup_hash.outputs.hash }}
restore-keys: |
${{ runner.os }}-cn1-tools-
- name: Restore cn1-binaries cache
uses: actions/cache@v4
with:
path: ../cn1-binaries
key: cn1-binaries-${{ runner.os }}-${{ steps.setup_hash.outputs.hash }}
restore-keys: |
cn1-binaries-${{ runner.os }}-
- name: Setup workspace
run: ./scripts/setup-workspace.sh -q -DskipTests
timeout-minutes: 40
- name: Build iOS port
run: ./scripts/build-ios-port.sh -q -DskipTests
timeout-minutes: 40
- name: Build sample iOS app
id: build_ios_app
env:
IOS_UISCENE: "false"
run: ./scripts/build-ios-app.sh -q -DskipTests
timeout-minutes: 30
- name: Run native iOS notification tests (XCTest)
env:
ARTIFACTS_DIR: ${{ github.workspace }}/artifacts/native-ios-tests
run: |
set -euo pipefail
mkdir -p "${ARTIFACTS_DIR}"
./scripts/run-ios-native-tests.sh \
"${{ steps.build_ios_app.outputs.workspace }}" \
"${{ steps.build_ios_app.outputs.scheme }}"
timeout-minutes: 25
- name: Upload native iOS artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: ios-native-tests
path: artifacts
if-no-files-found: warn
retention-days: 14