-
Notifications
You must be signed in to change notification settings - Fork 6
122 lines (97 loc) · 3.06 KB
/
ci.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
name: CI Pipeline
on:
push:
branches: ['main']
pull_request:
types: [opened, synchronize]
jobs:
lint-swift:
name: Lint Swift code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Run SwiftLint
uses: norio-nomura/action-swiftlint@9f4dcd7fd46b4e75d7935cf2f4df406d5cae3684 # 3.2.1
with:
args: --strict
license:
name: Verify license headers
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- run: ./scripts/copy_license && git diff --name-only --exit-code
check-packed-files:
name: Check package files
runs-on: ubuntu-latest
env:
TERM: xterm
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup
uses: ./.github/actions/setup
- run: |
yarn module clean
yarn module build
yarn compare-snapshot
lint:
name: Lint module + sample
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup
uses: ./.github/actions/setup
- run: |
yarn module build
yarn module lint
yarn sample lint
test:
name: Run jest tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup
uses: ./.github/actions/setup
- run: yarn test
test-android:
name: Run Android Tests
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup
uses: ./.github/actions/setup
- name: Install JDK
# if: env.turbo_cache_hit != 1
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: 'zulu'
java-version: '17'
- name: Run Android tests
run: |
yarn module build
yarn sample test:android --no-daemon
test-ios:
name: Run iOS Tests
runs-on: macos-13-xlarge
needs: [lint, lint-swift, test]
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup iOS Simulator
uses: ./.github/actions/setup-simulator
- name: Setup
uses: ./.github/actions/setup
- name: Check turbo cache
uses: ./.github/actions/use-turbo-cache
- name: Check build cache
run: |
CACHE_STATUS=$(./scripts/check_cache sample test:ios)
echo "[sample] build:ios - $CACHE_STATUS"
echo "turbo_cache_hit=$CACHE_STATUS" >> $GITHUB_ENV
- name: Install cocoapods
uses: ./.github/actions/install-cocoapods
- name: Run Swift tests
# If turbo has already cached the build it will return instantly here
run: |
yarn turbo run test:ios --cache-dir=".turbo" --no-daemon