Skip to content

Commit 6ac61fe

Browse files
authored
Add devcontainer to run tests (#109)
* Add devcontainer to run tests Includes a running build of mosquitto * Minor docker-compose changes Renamed setup -> app Add CI=true (to stop running tests checking against public mqtt server inside devcontainer)
1 parent bd559b1 commit 6ac61fe

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "MQTT Swift 5.6",
3+
"dockerComposeFile": "docker-compose.yml",
4+
"service": "app",
5+
"workspaceFolder": "/workspace",
6+
"extensions": [
7+
"sswg.swift-lang",
8+
],
9+
"settings": {
10+
"lldb.library": "/usr/lib/liblldb.so"
11+
},
12+
}

.devcontainer/docker-compose.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# run this with docker-compose -f docker/docker-compose.yml run test
2+
version: "3.3"
3+
4+
services:
5+
app:
6+
image: swift:5.6-focal
7+
volumes:
8+
- ..:/workspace
9+
depends_on:
10+
- mosquitto
11+
environment:
12+
- MOSQUITTO_SERVER=mosquitto
13+
- CI=true
14+
command: sleep infinity
15+
16+
mosquitto:
17+
image: eclipse-mosquitto
18+
volumes:
19+
- ../mosquitto/config:/mosquitto/config
20+
- ../mosquitto/certs:/mosquitto/certs
21+
ports:
22+
- "1883:1883"
23+
- "8883:8883"
24+
- "8080:8080"
25+
- "8081:8081"

0 commit comments

Comments
 (0)