This repository has been archived by the owner on Jun 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 283
202 lines (195 loc) · 6.91 KB
/
Nightly.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
name: Nightly Checks and Tasks
on:
workflow_dispatch:
schedule:
- cron: '5 20 * * 1-5' #Weekdays at 20:05
jobs:
dependencies:
runs-on: self-hosted
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Save Dependencies
uses: actions/cache@v2
id: cache-dependencies
env:
cache-name: cache-dependencies
with:
path: |
src/xcode/vendor
src/xcode/.bundle
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('src/xcode/Gemfile.lock') }}
- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: cd src/xcode && arch -arm64 bundle install --path=vendor
- name: Save Dependencies
uses: actions/cache@v2
if: steps.cache-dependencies.outputs.cache-hit != 'true'
env:
cache-name: cache-dependencies
with:
path: |
src/xcode/vendor
src/xcode/.bundle
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('src/xcode/Gemfile.lock') }}
buildForTesting:
runs-on: self-hosted
needs: dependencies
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Restore Dependencies
uses: actions/cache@v2
env:
cache-name: cache-dependencies
with:
path: |
src/xcode/vendor
src/xcode/.bundle
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('src/xcode/Gemfile.lock') }}
- name: Build for testing
run: |
cd src/xcode && arch -arm64 bundle exec fastlane build_for_testing
- name: Save DerivedData folder
uses: actions/cache@v2
env:
cache-name: cache-derived-data
with:
path: src/xcode/DerivedData
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.sha }}
- name: Save test_output folder
uses: actions/cache@v2
env:
cache-name: cache-test-output
with:
path: src/xcode/fastlane/test_output
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.sha }}
snapshot:
runs-on: self-hosted
needs: buildForTesting
strategy:
matrix:
language: ["de-DE", "en-EN"]
displaymode: ["dark", "light"]
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Restore Dependencies
uses: actions/cache@v2
env:
cache-name: cache-dependencies
with:
path: |
src/xcode/vendor
src/xcode/.bundle
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('src/xcode/Gemfile.lock') }}
- name: Restore DerivedData folder
uses: actions/cache@v2
env:
cache-name: cache-derived-data
with:
path: src/xcode/DerivedData
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.sha }}
- name: Restore test_output folder
uses: actions/cache@v2
env:
cache-name: cache-test-output
with:
path: src/xcode/fastlane/test_output
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.sha }}
- name: Snapshot ${{ matrix.language }}-${{ matrix.displaymode }}
run: |
cd src/xcode && arch -arm64 bundle exec fastlane screenshot languages:${{ matrix.language }} mode:${{ matrix.displaymode }}
- name: Archive xcresult
if: failure()
uses: actions/upload-artifact@v2
with:
name: xcresult-${{ github.sha }}
path: src/xcode/fastlane/test_output/ENA.xcresult.zip
- name: Remove test_output folder
run: |
cd src/xcode/screenshots/screenshots-${{ matrix.language }}-${{ matrix.displaymode }}
rm -r test_output
- uses: actions/upload-artifact@v2
with:
name: screenshots-${{ github.sha }}
path: src/xcode/screenshots
runAllTests:
runs-on: self-hosted
needs: buildForTesting
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Restore Dependencies
uses: actions/cache@v2
env:
cache-name: cache-dependencies
with:
path: |
src/xcode/vendor
src/xcode/.bundle
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('src/xcode/Gemfile.lock') }}
- name: Restore DerivedData folder
uses: actions/cache@v2
env:
cache-name: cache-derived-data
with:
path: src/xcode/DerivedData
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.sha }}
- name: Restore test_output folder
uses: actions/cache@v2
env:
cache-name: cache-test-output
with:
path: src/xcode/fastlane/test_output
key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.sha }}
- name: Run AllTests
run: |
cd src/xcode
arch -arm64 bundle exec fastlane test_without_building testplan:AllTests
- name: Archive xcresult
if: always()
uses: actions/upload-artifact@v3
with:
name: xcresult-${{ github.sha }}
path: src/xcode/fastlane/test_output/ENA.xcresult.zip
sonar:
runs-on: self-hosted
needs: runAllTests
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Restore Dependencies
uses: actions/cache@v2
env:
cache-name: cache-dependencies
with:
path: |
src/xcode/vendor
src/xcode/.bundle
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('src/xcode/Gemfile.lock') }}
- name: Download xcresult
uses: actions/download-artifact@v3
with:
name: xcresult-${{ github.sha }}
- name: Convert coverage information to SonarCloud format
run: |
unzip ENA.xcresult.zip
./scripts/cococo \
ENA.xcresult > \
coverage.xml
- name: Install and run sonar-scanner
env:
SONAR_TOKEN: '${{ secrets.SONAR_TOKEN }}'
SONARQUBE_SCANNER_PARAMS: '{"sonar.host.url":"https://sonarcloud.io", "sonar.branch.name": "main"}'
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN_GITHUB }}
run: |
SCANNER=sonar-scanner-cli-4.3.0.2102-macosx
SCANNERDIR=~/sonar/sonar-scanner-4.3.0.2102-macosx
if [[ ! -x "$SCANNERDIR/bin/sonar-scanner" ]]; then
curl -Ol https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/$SCANNER.zip
unzip -qq -o $SCANNER.zip -d ~/sonar/
fi
chmod +x $SCANNERDIR/bin/sonar-scanner
chmod +x $SCANNERDIR/jre/bin/java
$SCANNERDIR/bin/sonar-scanner