-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (48 loc) · 1.51 KB
/
main.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
name: XCUITest
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 8 */4 * *'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
xcode: [ '14.1', 'latest' ]
os: [ macos-latest ]
steps:
- uses: actions/checkout@v4
- name: Cache bundle directory
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-
- name: bundler
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: set Xcode Version ${{ matrix.xcode }}
run: |
if [ "${{ matrix.xcode }}" = 'latest' ]; then
export XCODE_BETA_APP=`ls /Applications/ | grep Xcode_ | awk 'match($0, /.*beta.*/) {print substr($0, RSTART, RLENGTH-9)}' | sort -n | tail -1`
if [ "${XCODE_BETA_APP}" = "" ]; then
export XCODE_APP=`ls /Applications/ | grep Xcode_ | awk '$0 ~ /.*\.app/' | sort -n | tail -1`
else
export XCODE_APP="${XCODE_BETA_APP}_beta.app"
fi
else
export XCODE_APP="Xcode_${{ matrix.xcode }}.app"
fi
echo "set: ${XCODE_APP}"
echo "XCODE_VERSION=${XCODE_APP}" >> $GITHUB_ENV
- name: run test with ${{ matrix.xcode }}
run: |
echo "set: ${XCODE_VERSION}"
DEVELOPER_DIR="/Applications/${XCODE_VERSION}/Contents/Developer" bundle exec fastlane test