Skip to content

Commit 5222d2f

Browse files
authored
Merge pull request SRombauts#407 Create Meson CI from ninjaoflight/patch-1
2 parents 53a2b81 + 5070350 commit 5222d2f

File tree

2 files changed

+374
-290
lines changed

2 files changed

+374
-290
lines changed

.github/workflows/meson.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: meson
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
name: (Meson) ${{ matrix.config.name }}
8+
runs-on: ${{ matrix.config.os }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
config:
13+
- {
14+
name: "Windows Latest MSVC",
15+
os: windows-latest,
16+
cc: "cl", cxx: "cl",
17+
extra_path: "",
18+
requires_msvc: true,
19+
}
20+
- {
21+
name: "Windows Latest MinGW",
22+
os: windows-latest,
23+
cc: "gcc", cxx: "g++",
24+
extra_path: "C:\\ProgramData\\chocolatey\\lib\\mingw\\tools\\install\\mingw64\\bin",
25+
}
26+
- {
27+
name: "Windows Latest Clang",
28+
os: windows-latest,
29+
cc: "clang", cxx: "clang++", c_ld: "lld-link", cxx_ld: "lld-link",
30+
extra_path: "",
31+
}
32+
- {
33+
name: "Ubuntu Latest GCC",
34+
os: ubuntu-latest,
35+
cc: "gcc", cxx: "g++",
36+
extra_path: ""
37+
}
38+
- {
39+
name: "Ubuntu Latest Clang",
40+
os: ubuntu-latest,
41+
cc: "clang", cxx: "clang++", c_ld: "lld", cxx_ld: "lld",
42+
extra_path: ""
43+
}
44+
- {
45+
name: "macOS Latest Clang",
46+
os: macos-latest,
47+
cc: "clang", cxx: "clang++",
48+
extra_path: ""
49+
}
50+
51+
steps:
52+
- uses: actions/checkout@v3
53+
# use msvc-dev-cmd to setup the environment for MSVC if needed
54+
- name: setup MSVC
55+
if: matrix.config.requires_msvc
56+
uses: ilammy/msvc-dev-cmd@v1
57+
- name: extra_path
58+
shell: bash
59+
run: echo "${{matrix.config.extra_path}}" >> $GITHUB_PATH
60+
- name: install prerequisites
61+
run: |
62+
# asuming that python and pip are already installed
63+
pip3 install meson ninja
64+
- name: setup meson project
65+
env: # set proper compilers and linkers for meson
66+
CC: ${{matrix.config.cc}}
67+
CXX: ${{matrix.config.cxx}}
68+
C_LD: ${{matrix.config.c_ld}}
69+
CXX_LD: ${{matrix.config.cxx_ld}}
70+
run: |
71+
# setup the build directory with tests and examples enabled
72+
meson setup builddir -DSQLITECPP_BUILD_TESTS=true -DSQLITECPP_BUILD_EXAMPLES=true --force-fallback-for=sqlite3
73+
- name: build meson project
74+
run: |
75+
# build the project
76+
meson compile -C builddir
77+
- name: test
78+
run: |
79+
# run the tests
80+
meson test -C builddir

0 commit comments

Comments
 (0)