-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (98 loc) · 3.29 KB
/
Copy pathci.yml
File metadata and controls
112 lines (98 loc) · 3.29 KB
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
name: Nick CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
build-and-test:
runs-on: macos-26
timeout-minutes: 45
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
steps:
- name: Check out source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
lfs: true
- name: Select Xcode
run: |
XCODE_PATH="$(find /Applications -maxdepth 1 -type d -name 'Xcode*.app' | sort -V | tail -1)"
test -n "$XCODE_PATH"
sudo xcode-select -s "$XCODE_PATH"
xcodebuild -version
- name: Build Nick
run: |
xcodebuild build \
-project Nick.xcodeproj \
-scheme Nick \
-destination "platform=macOS" \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO
- name: Build shipping components
run: |
for scheme in NickExtension NickNetFilter NickHelper NickUninstaller; do
xcodebuild build \
-project Nick.xcodeproj \
-scheme "$scheme" \
-destination "platform=macOS" \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO
done
- name: Run Tests
run: |
rm -rf TestResults.xcresult
xcodebuild test \
-project Nick.xcodeproj \
-scheme Nick \
-destination "platform=macOS" \
-enableCodeCoverage YES \
-resultBundlePath TestResults.xcresult \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO
- name: Test Summary
if: always()
run: |
xcrun xcresulttool get test-results summary \
--path TestResults.xcresult 2>/dev/null || echo "Test results unavailable"
- name: Upload Xcode result bundle
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: TestResults
path: TestResults.xcresult
if-no-files-found: warn
retention-days: 14
- name: Convert coverage for Codecov
run: |
./Scripts/xccov-to-lcov.sh TestResults.xcresult > coverage.lcov
test -s coverage.lcov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v6.0.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: coverage.lcov
disable_search: true
flags: macos
use_pypi: true
version: v11.3.1
- name: Convert coverage for SonarCloud
if: env.SONAR_TOKEN != ''
run: |
./Scripts/xccov-to-sonarqube.sh TestResults.xcresult > sonar-coverage.xml
test -s sonar-coverage.xml
- name: Run SonarCloud analysis
if: env.SONAR_TOKEN != ''
uses: SonarSource/sonarqube-scan-action@c7ee0f9df90b7aa20e8dcf9695dcfe2e7da5b4f2 # v7.2.1
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.qualitygate.wait=true