use meson in ci

This commit is contained in:
2025-02-19 16:07:30 -06:00
parent 45be7d9392
commit 2563e78e6d
3 changed files with 43 additions and 38 deletions

View File

@@ -18,24 +18,8 @@ jobs:
linux: linux:
name: Linux (Ubuntu) name: Linux (Ubuntu)
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: container:
fail-fast: false image: gitea.pockle.world/john/prosperon/linux:latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y
- name: Stats
run: |
./qjs -qd
- name: Run built-in tests
run: |
make test
- name: Run microbench
run: |
make microbench
linux-lto: linux-lto:
name: Linux LTO name: Linux LTO
@@ -76,29 +60,30 @@ jobs:
make CONFIG_M32=y test make CONFIG_M32=y test
linux-asan: linux-asan:
runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - name: Check out
uses: actions/checkout@v4
with: with:
submodules: true fetch-depth: 0
- name: Build
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_ASAN=y
- name: Run built-in tests
env:
ASAN_OPTIONS: halt_on_error=1
run: |
make CONFIG_ASAN=y test
linux-msan: - name: Test
run: |
meson setup build -Dbuildtype=release -Db_lto=true -Db_ndebug=true
meson test -C build
windows:
name: Windows (mingw)
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: gitea.pockle.world/john/prosperon/linux:latest
steps: steps:
- uses: actions/checkout@v4 - name: Check out
uses: actions/checkout@v4
with: with:
submodules: true fetch-depth: 0
- name: Build
env: - name: Test
CC: clang
run: | run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_MSAN=y CONFIG_CLANG=y make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_MSAN=y CONFIG_CLANG=y
- name: Run built-in tests - name: Run built-in tests
@@ -283,3 +268,5 @@ jobs:
run: docker run --privileged --rm tonistiigi/binfmt:master --install all run: docker run --privileged --rm tonistiigi/binfmt:master --install all
- name: Run tests on ${{ matrix.platform }} - name: Run tests on ${{ matrix.platform }}
run: docker run --rm --interactive --mount type=bind,source=$(pwd),target=/host --platform ${{ matrix.platform }} alpine sh -c "apk add git patch make gcc libc-dev && cd /host && make test" run: docker run --rm --interactive --mount type=bind,source=$(pwd),target=/host --platform ${{ matrix.platform }} alpine sh -c "apk add git patch make gcc libc-dev && cd /host && make test"
meson setup build -Dbuildtype=release -Db_lto=true -Db_ndebug=true --cross-file mingw32.cross
meson test -C build

View File

@@ -2,10 +2,13 @@ project('quickjs', 'c')
cc = meson.get_compiler('c') cc = meson.get_compiler('c')
threads = dependency('threads')
deps = [] deps = []
deps += cc.find_library('m', required:false) deps += cc.find_library('m', required:false)
deps += threads
add_project_arguments('-DCONFIG_VERSION="2024-02-14"', language : 'c') add_project_arguments('-DCONFIG_VERSION="2024-02-14"', '-mcmodel=large', language: 'c')
if get_option('bignum') if get_option('bignum')
add_project_arguments('-DCONFIG_BIGNUM', language : 'c') add_project_arguments('-DCONFIG_BIGNUM', language : 'c')
@@ -25,8 +28,6 @@ libquickjs = library('quickjs',
quickjs_dep = declare_dependency(link_with: libquickjs, include_directories: include_directories('.'), dependencies: deps) quickjs_dep = declare_dependency(link_with: libquickjs, include_directories: include_directories('.'), dependencies: deps)
threads = dependency('threads')
qjsc = executable('qjsc', qjsc = executable('qjsc',
'qjsc.c', 'quickjs-libc.c', 'qjsc.c', 'quickjs-libc.c',
dependencies: [quickjs_dep,threads], dependencies: [quickjs_dep,threads],

17
mingw32.cross Normal file
View File

@@ -0,0 +1,17 @@
[binaries]
c = 'x86_64-w64-mingw32-gcc'
cpp = 'x86_64-w64-mingw32-g++'
ar = 'x86_64-w64-mingw32-ar'
windres = 'x86_64-w64-mingw32-windres'
strip = 'x86_64-w64-mingw32-strip'
exe_wrapper = 'wine'
pkg-config = 'pkg-config'
[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'
[properties]
needs_exe_wrapper = true