-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
121 lines (111 loc) · 3.08 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
name: CI
on:
workflow_dispatch:
workflow_call:
pull_request:
paths:
- Sources/**
- Tests/**
- .github/workflows/ci.yml
- PromiseKit.xcodeproj/**
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
linux:
runs-on: ubuntu-latest
strategy:
matrix:
swift:
- 4.0.3
- 4.1.3
- 4.2.4
container:
image: swift:${{ matrix.swift }}
steps:
- uses: actions/checkout@v2
- run: swift build -Xswiftc -warnings-as-errors -Xswiftc -swift-version -Xswiftc 3
- run: swift build # generated linuxmain requires Swift 5 sadly
linux-code-cov:
name: linux
runs-on: ubuntu-latest
strategy:
matrix:
swift:
- '5.0'
- 5.1
- 5.2
- 5.3
- 5.4
- 5.5
- 5.6
container:
image: swift:${{ matrix.swift }}
steps:
- uses: actions/checkout@v2
- run: swift build -Xswiftc -warnings-as-errors -Xswiftc -swift-version -Xswiftc 4
- run: swift build -Xswiftc -warnings-as-errors -Xswiftc -swift-version -Xswiftc 4.2
- run: swift test --enable-code-coverage --parallel
- name: Generate Coverage Report
if: ${{ matrix.swift < 5.4 }} # fails for SOME REASON
run: |
apt-get -qq update
apt-get -qq install llvm-10 curl
export b=$(swift build --show-bin-path) && llvm-cov-10 \
export -format lcov \
-instr-profile=$b/codecov/default.profdata \
--ignore-filename-regex='\.build/' \
$b/*.xctest \
> info.lcov
- uses: codecov/codecov-action@v1
with:
file: ./info.lcov
verify-linuxmain:
runs-on: macos-latest
name: linux (validate manifests)
steps:
- uses: actions/checkout@v2
- run: swift test --generate-linuxmain
- run: git diff --exit-code
test:
runs-on: macos-latest
strategy:
matrix:
dst:
- platform=macOS
- platform=tvOS Simulator,OS=15.0,name=Apple TV
- platform=iOS Simulator,OS=15.0,name=iPhone 12
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 13.1
- uses: actions/checkout@v2
- uses: sersoft-gmbh/xcodebuild-action@v1
with:
project: PromiseKit.xcodeproj
scheme: PromiseKit
destination: ${{ matrix.dst }}
action: test
enable-code-coverage: true
- uses: codecov/codecov-action@v1
carthage:
runs-on: ${{ matrix.macos }}
strategy:
matrix:
xcode: [^11, ^12, ^13]
macos: [macos-11]
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.xcode }}
- uses: actions/checkout@v2
- uses: mingjun97/file-regex-replace@v1
with:
regex: SWIFT_TREAT_WARNINGS_AS_ERRORS = NO
replacement: SWIFT_TREAT_WARNINGS_AS_ERRORS = YES
include: project.pbxproj
- run: |
if [ ${{ matrix.xcode }} != ^11 ]; then
echo "CARTHAGE_ARGS=--use-xcframeworks" >> $GITHUB_ENV
fi
- run: carthage build --no-skip-current --no-use-binaries $CARTHAGE_ARGS