Skip to content

Commit 75a03e0

Browse files
committed
feat: add ci pipeline
1 parent da138f4 commit 75a03e0

File tree

1 file changed

+82
-0
lines changed

1 file changed

+82
-0
lines changed

.github/workflows/ci.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint-mqtt:
11+
name: Lint MQTT
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v5
15+
- uses: actions/setup-go@v6
16+
with:
17+
go-version-file: "mqtt/go.mod"
18+
19+
- name: golangci-lint
20+
uses: golangci/golangci-lint-action@v6
21+
with:
22+
version: latest
23+
working-directory: mqtt
24+
25+
lint-coap:
26+
name: Lint CoAP
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v5
30+
- uses: actions/setup-go@v6
31+
with:
32+
go-version-file: "coap/go.mod"
33+
34+
- name: golangci-lint
35+
uses: golangci/golangci-lint-action@v6
36+
with:
37+
version: latest
38+
working-directory: coap
39+
40+
build-mqtt:
41+
name: Build MQTT
42+
runs-on: ubuntu-latest
43+
needs: lint-mqtt
44+
strategy:
45+
matrix:
46+
component: [producer, consumer]
47+
steps:
48+
- uses: actions/checkout@v5
49+
50+
- uses: actions/setup-go@v6
51+
with:
52+
go-version-file: "mqtt/go.mod"
53+
54+
- name: Download dependencies
55+
working-directory: mqtt/${{ matrix.component }}
56+
run: go mod download
57+
58+
- name: Build ${{ matrix.component }}
59+
working-directory: mqtt/${{ matrix.component }}
60+
run: go build -v -o ../../bin/mqtt-${{ matrix.component }} .
61+
62+
build-coap:
63+
name: Build CoAP
64+
runs-on: ubuntu-latest
65+
needs: lint-coap
66+
strategy:
67+
matrix:
68+
component: [server, client]
69+
steps:
70+
- uses: actions/checkout@v5
71+
72+
- uses: actions/setup-go@v6
73+
with:
74+
go-version-file: "coap/go.mod"
75+
76+
- name: Download dependencies
77+
working-directory: coap/${{ matrix.component }}
78+
run: go mod download
79+
80+
- name: Build ${{ matrix.component }}
81+
working-directory: coap/${{ matrix.component }}
82+
run: go build -v -o ../../bin/coap-${{ matrix.component }} .

0 commit comments

Comments
 (0)