-
Notifications
You must be signed in to change notification settings - Fork 33
148 lines (120 loc) · 3.91 KB
/
_build.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
name: Build
on:
workflow_call:
defaults:
run:
shell: bash -l {0}
jobs:
Setup:
name: Install Dependencies
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Verify Bundler Version
run: if [[ $(cat Gemfile.lock | sed -n '/BUNDLED WITH/{n;p;}' | sed '/^$/d;s/[[:blank:]]//g') != "2.2.3" ]]; then echo "Error - Gemfile.lock should be bundled with bundler 2.2.3"; exit 64; fi
- name: Set up node and ruby
uses: asdf-vm/actions/install@v3 # Sets ruby and node version via `.tool-versions`
Lint:
name: Lint Project
runs-on: macos-13
needs: [Setup]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache Node modules
uses: actions/cache@v4
id: cache_node_modules
with:
path: node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node_modules-
- name: NPM ci
if: steps.cache_node_modules.outputs.cache-hit != 'true'
run: npm ci
- name: Run NPM build
run: npm run build
- name: Cache Bundler install Gems
uses: actions/cache@v4
id: cache_bundler_install_gems
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ env.ImageVersion }}-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-${{ env.ImageVersion }}
- name: Cache Pods
uses: actions/cache@v4
id: cache_pods
with:
path: Example/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Bundle Install
run: bundle install --jobs 4 --retry 3
- name: Pod Install
if: steps.cache_pods.outputs.cache-hit != 'true'
run: bundle exec pod install
working-directory: Example
- name: Select Xcode 14
run: sudo xcode-select --switch /Applications/Xcode_14.2.app
- name: Install clang-format
run: brew install clang-format
- name: Check pristine
run: ./scripts/lint
- name: Run Swiftlint
run: Pods/SwiftLint/swiftlint lint --strict --config .swiftlint.yml
working-directory: Example
- name: Run danger
run: npm run danger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AnalyzePods:
name: Analyzing pods
runs-on: macos-13
needs: [Setup]
strategy:
fail-fast: false
matrix:
schemes: [common, uikit, swiftui]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache Bundler install Gems
uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ env.ImageVersion }}-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-${{ env.ImageVersion }}
- name: Cache Pods
uses: actions/cache@v4
with:
path: Example/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Bundle Install
run: bundle install --jobs 4 --retry 3
- name: Pod Install
run: bundle exec pod install
working-directory: Example
- name: Select Xcode 14
run: sudo xcode-select --switch /Applications/Xcode_14.2.app
- name: Analyze
run: ./scripts/ci ${{ matrix.schemes }} analysis
TestPods:
name: Testing Pods
needs: [Setup]
uses: ./.github/workflows/_test.yml
UploadArtifacts:
name: Upload Artifacts
runs-on: macos-13
needs: [TestPods]
steps:
- name: Save assets
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: FailureDiffs
path: Example/BackpackTests/FailureDiffs