This repository has been archived by the owner on Sep 27, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
96 lines (79 loc) · 2.7 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
name: iOS
on:
push:
branches: [ main, "version-*" ]
pull_request:
branches: [ "main" ]
types: [ labeled, synchronize, opened, reopened ]
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.ref == 'refs/heads/main' && format('ios-build-main-{0}', github.sha) || format('ios-build-pr-{0}', github.ref) }}
cancel-in-progress: true
jobs:
build:
if: |
github.event_name == 'push' ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'iOS'))
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Setup - Ruby and bundler dependencies
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Rust & Cargo cache
uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.65
profile: minimal
override: true
- name: Install targets
run: |
rustup target add aarch64-apple-ios
rustup target add aarch64-apple-ios-sim
rustup target add x86_64-apple-ios
- name: Set XCode 14.2
run: sudo xcode-select -switch /Applications/Xcode_14.2.app
- name: Build framework & bindings
run: make ios
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: get_branch
- name: Unit test coverage
working-directory: platforms/ios/example
run: exec ./ios-test-coverage.sh
- name: Run slather for unit tests
run: bundle exec slather
env:
GIT_BRANCH: ${{ steps.get_branch.outputs.branch }}
CI_PULL_REQUEST: ${{ github.event.number }}
- name: Upload unit test coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: platforms/ios/lib/coverage
fail_ci_if_error: true
flags: unittests-ios, unittests
# https://github.com/codecov/codecov-action/issues/557#issuecomment-1216749652
token: ${{ secrets.CODECOV_TOKEN }}
- name: UI test coverage
working-directory: platforms/ios/example
run: exec ./ios-ui-test-coverage.sh
- name: Run slather for ui tests
run: bundle exec slather
env:
GIT_BRANCH: ${{ steps.get_branch.outputs.branch }}
CI_PULL_REQUEST: ${{ github.event.number }}
- name: Upload ui test coverage to Codecov
uses: codecov/codecov-action@v3
with:
directory: platforms/ios/lib/coverage
fail_ci_if_error: true
flags: uitests-ios, uitests
# https://github.com/codecov/codecov-action/issues/557#issuecomment-1216749652
token: ${{ secrets.CODECOV_TOKEN }}