summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2024-03-03 14:14:23 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2024-03-03 14:14:23 +0100
commite17cb9fc7aac2432bbefeec9a31e186329e511b0 (patch)
treed115d28a62a4bdd02bb7aaee6ff298b9ba1e496f
parent06c100c9bfeef0d0c1d138153321491f7884cef3 (diff)
downloadquickjs-e17cb9fc7aac2432bbefeec9a31e186329e511b0.tar.gz
quickjs-e17cb9fc7aac2432bbefeec9a31e186329e511b0.zip
Add github CI tests
- disable `isatty()` test in `test_os()` - add `.github/workflows/ci.yml` with 8 targets
-rw-r--r--.github/workflows/ci.yml141
-rw-r--r--tests/test_std.js3
2 files changed, 143 insertions, 1 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..7565477
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,141 @@
+name: ci
+
+on:
+ pull_request:
+ paths:
+ - '**'
+ - '!.gitignore'
+ - '!LICENSE'
+ - '!TODO'
+ - '!doc/**'
+ - '!examples/**'
+ - '.github/workflows/ci.yml'
+ push:
+ branches:
+ - master
+
+jobs:
+ linux:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ submodules: true
+ - name: build
+ run: |
+ make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y
+ - name: stats
+ run: |
+ ./qjs -qd
+ - name: test
+ run: |
+ make test
+ - name: microbench
+ run: |
+ make microbench
+
+ linux-asan:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ submodules: true
+ - name: build
+ run: |
+ make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_ASAN=y
+ - name: test
+ env:
+ ASAN_OPTIONS: halt_on_error=1
+ run: |
+ make CONFIG_ASAN=y test
+
+ linux-msan:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ submodules: true
+ - name: build
+ env:
+ CC: clang
+ run: |
+ make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_MSAN=y CONFIG_CLANG=y
+ - name: test
+ env:
+ MSAN_OPTIONS: halt_on_error=1
+ run: |
+ make CONFIG_MSAN=y CONFIG_CLANG=y test
+
+ linux-ubsan:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ submodules: true
+ - name: build
+ run: |
+ make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_UBSAN=y
+ - name: test
+ env:
+ UBSAN_OPTIONS: halt_on_error=1
+ run: |
+ make CONFIG_UBSAN=y test
+
+ macos:
+ runs-on: macos-latest
+ strategy:
+ fail-fast: false
+ steps:
+ - uses: actions/checkout@v3
+ - name: build
+ run: |
+ make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y
+ - name: stats
+ run: |
+ ./qjs -qd
+ - name: test
+ run: |
+ make test
+
+ macos-asan:
+ runs-on: macos-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: build
+ run: |
+ make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_ASAN=y
+ - name: test
+ env:
+ ASAN_OPTIONS: halt_on_error=1
+ run: |
+ make CONFIG_ASAN=y test
+
+ macos-ubsan:
+ runs-on: macos-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: build
+ run: |
+ make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_UBSAN=y
+ - name: test
+ env:
+ UBSAN_OPTIONS: halt_on_error=1
+ run: |
+ make CONFIG_UBSAN=y test
+
+ freebsd:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: build + test
+ uses: vmactions/freebsd-vm@v1
+ with:
+ usesh: true
+ prepare: |
+ pkg install -y gmake
+ run: |
+ gmake
+ ./qjs -qd
+ gmake test
diff --git a/tests/test_std.js b/tests/test_std.js
index 562c96c..86a242c 100644
--- a/tests/test_std.js
+++ b/tests/test_std.js
@@ -144,7 +144,8 @@ function test_os()
{
var fd, fpath, fname, fdir, buf, buf2, i, files, err, fdate, st, link_path;
- assert(os.isatty(0));
+ // XXX(bnoordhuis) disabled because stdio is not a tty on CI
+ //assert(os.isatty(0));
fdir = "test_tmp_dir";
fname = "tmp_file.txt";