-
-
Notifications
You must be signed in to change notification settings - Fork 32
101 lines (96 loc) · 2.77 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types: [published]
workflow_dispatch:
jobs:
macos:
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install and run Mosquitto
run: |
brew install mosquitto
mosquitto -d -c mosquitto/config/mosquitto.conf
- name: SPM tests
run: swift test --enable-code-coverage
- name: Convert coverage files
run: |
xcrun llvm-cov export -format "lcov" \
.build/debug/mqtt-nioPackageTests.xctest/Contents/MacOs/mqtt-nioPackageTests \
-ignore-filename-regex="\/Tests\/" \
-instr-profile=.build/debug/codecov/default.profdata > info.lcov
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: info.lcov
ios:
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Xcodebuild
run: |
xcodebuild build -scheme mqtt-nio -destination 'platform=iOS Simulator,name=iPhone 11'
linux:
runs-on: ubuntu-latest
strategy:
matrix:
tag:
- swift:5.7
- swift:5.8
- swift:5.9
- swift:5.10
- swift:6.0
container:
image: ${{ matrix.tag }}
services:
mosquitto:
image: eclipse-mosquitto
options: --name mosquitto
ports:
- 1883:1883
- 1884:1884
- 8883:8883
- 8080:8080
- 8081:8081
volumes:
- ${{ github.workspace }}/mosquitto/config:/mosquitto/config
- ${{ github.workspace }}/mosquitto/certs:/mosquitto/certs
- ${{ github.workspace }}/mosquitto/socket:/mosquitto/socket
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restart Mosquitto
# The mosquitto service container is started *before* mqtt-nio is checked
# out. Restarting the container after the checkout step is needed for the
# container to see volumes populated from the checked out workspace.
uses: docker://docker
with:
args: docker restart mosquitto
- name: Test
env:
MOSQUITTO_SERVER: mosquitto
run: |
swift test --enable-test-discovery --enable-code-coverage
- name: Convert coverage files
run: |
llvm-cov export -format="lcov" \
.build/debug/mqtt-nioPackageTests.xctest \
-ignore-filename-regex="\/Tests\/" \
-instr-profile .build/debug/codecov/default.profdata > info.lcov
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: info.lcov