-
Notifications
You must be signed in to change notification settings - Fork 13
105 lines (75 loc) · 2.38 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
name: CI
on:
push:
branches: [ main ]
pull_request:
types: [ opened, synchronize, reopened ]
branches: [ main ]
jobs:
check-build-test:
runs-on: macos-13
steps:
- name: Install Tools
run: |
brew tap a7ex/homebrew-formulae
brew install xcbeautify sonar-scanner findsimulator
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
- name: SwiftLint
run: |
mkdir .build
swiftlint lint --reporter json > .build/swiftlint.json
- name: Build/Test
run: set -o pipefail && swift test --enable-code-coverage --sanitize undefined | xcbeautify
- name: Convert Coverage
run: xcrun llvm-cov show -instr-profile=.build/debug/codecov/default.profdata .build/debug/PotentCodablesPackageTests.xctest/Contents/MacOS/PotentCodablesPackageTests > .build/coverage.report
- name: Sonar Scanner
run: sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
build-test:
runs-on: macos-12
needs: [check-build-test]
strategy:
matrix:
platform: [macos, ios, tvos, watchos]
steps:
- name: Install Tools
run: |
brew tap a7ex/homebrew-formulae
brew install xcbeautify findsimulator
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
- uses: actions/checkout@v3
- name: Select Xcode
run: sudo xcode-select -s /Applications/Xcode_14.1.app/Contents/Developer
- name: Build/Test
run: make build-test-${{ matrix.platform }}
- name: Report Test Results
uses: kishikawakatsumi/xcresulttool@v1
if: always()
with:
title: Test Results ${{ matrix.platform }}
path: ./TestResults/${{ matrix.platform }}.xcresult
build-test-linux:
runs-on: ubuntu-latest
needs: [check-build-test]
steps:
- uses: actions/checkout@v3
- name: Setup Swift
uses: swift-actions/setup-swift@v1
- name: Build/Test
run: swift test --parallel --xunit-output test-results.xml
- name: Report Test Results
uses: dorny/test-reporter@v1
if: always()
with:
name: Test Results linux
path: test-results.xml
reporter: java-junit