Skip to content

Commit dff2d5b

Browse files
committed
ci.yml
1 parent 9ce17e7 commit dff2d5b

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Build and Test
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize, ready_for_review]
6+
7+
jobs:
8+
build-and-test:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
include:
13+
- os: ubuntu-latest
14+
generator: Ninja
15+
- os: windows-latest
16+
generator: "Visual Studio 17 2022"
17+
18+
runs-on: ${{ matrix.os }}
19+
20+
steps:
21+
- name: Install additional dependencies
22+
if: matrix.os == 'ubuntu-latest'
23+
run: |
24+
sudo apt-get install -y --no-install-recommends mono-runtime libmono-system-json-microsoft4.0-cil libmono-system-data4.0-cil # TODO add mosquitto package
25+
26+
- name: Checkout project repo
27+
uses: actions/checkout@v4
28+
with:
29+
ref: ${{ github.event.inputs.branch || github.event.client_payload.branch || github.ref }}
30+
31+
- name: Configure project with CMake
32+
run: cmake -B build/output -S . -G "${{ matrix.generator }}" -DTODO_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Debug
33+
34+
- name: Build project with CMake
35+
run: cmake --build build/output --config Debug
36+
37+
- name: Install and run mosquitto Linux
38+
if: matrix.os == 'ubuntu-latest'
39+
run: |
40+
sudo apt-get install -y --no-install-recommends # TODO add mosquitto package name
41+
# TODO mosquitto run cmds
42+
43+
- name: Install and run mosquitto Windows
44+
if: matrix.os == 'windows-latest'
45+
run: # TODO install and run mosquitto
46+
47+
- name: Run project tests with CMake
48+
run: ctest --test-dir build/output --output-on-failure -C Debug

0 commit comments

Comments
 (0)