Skip to content

Commit e17cb9f

Browse files
committed
Add github CI tests
- disable `isatty()` test in `test_os()` - add `.github/workflows/ci.yml` with 8 targets
1 parent 06c100c commit e17cb9f

File tree

2 files changed

+143
-1
lines changed

2 files changed

+143
-1
lines changed

.github/workflows/ci.yml

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: ci
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- '**'
7+
- '!.gitignore'
8+
- '!LICENSE'
9+
- '!TODO'
10+
- '!doc/**'
11+
- '!examples/**'
12+
- '.github/workflows/ci.yml'
13+
push:
14+
branches:
15+
- master
16+
17+
jobs:
18+
linux:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false
22+
steps:
23+
- uses: actions/checkout@v3
24+
with:
25+
submodules: true
26+
- name: build
27+
run: |
28+
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y
29+
- name: stats
30+
run: |
31+
./qjs -qd
32+
- name: test
33+
run: |
34+
make test
35+
- name: microbench
36+
run: |
37+
make microbench
38+
39+
linux-asan:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v3
43+
with:
44+
submodules: true
45+
- name: build
46+
run: |
47+
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_ASAN=y
48+
- name: test
49+
env:
50+
ASAN_OPTIONS: halt_on_error=1
51+
run: |
52+
make CONFIG_ASAN=y test
53+
54+
linux-msan:
55+
runs-on: ubuntu-latest
56+
steps:
57+
- uses: actions/checkout@v3
58+
with:
59+
submodules: true
60+
- name: build
61+
env:
62+
CC: clang
63+
run: |
64+
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_MSAN=y CONFIG_CLANG=y
65+
- name: test
66+
env:
67+
MSAN_OPTIONS: halt_on_error=1
68+
run: |
69+
make CONFIG_MSAN=y CONFIG_CLANG=y test
70+
71+
linux-ubsan:
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v3
75+
with:
76+
submodules: true
77+
- name: build
78+
run: |
79+
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_UBSAN=y
80+
- name: test
81+
env:
82+
UBSAN_OPTIONS: halt_on_error=1
83+
run: |
84+
make CONFIG_UBSAN=y test
85+
86+
macos:
87+
runs-on: macos-latest
88+
strategy:
89+
fail-fast: false
90+
steps:
91+
- uses: actions/checkout@v3
92+
- name: build
93+
run: |
94+
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y
95+
- name: stats
96+
run: |
97+
./qjs -qd
98+
- name: test
99+
run: |
100+
make test
101+
102+
macos-asan:
103+
runs-on: macos-latest
104+
steps:
105+
- uses: actions/checkout@v3
106+
- name: build
107+
run: |
108+
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_ASAN=y
109+
- name: test
110+
env:
111+
ASAN_OPTIONS: halt_on_error=1
112+
run: |
113+
make CONFIG_ASAN=y test
114+
115+
macos-ubsan:
116+
runs-on: macos-latest
117+
steps:
118+
- uses: actions/checkout@v3
119+
- name: build
120+
run: |
121+
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y CONFIG_UBSAN=y
122+
- name: test
123+
env:
124+
UBSAN_OPTIONS: halt_on_error=1
125+
run: |
126+
make CONFIG_UBSAN=y test
127+
128+
freebsd:
129+
runs-on: ubuntu-latest
130+
steps:
131+
- uses: actions/checkout@v3
132+
- name: build + test
133+
uses: vmactions/freebsd-vm@v1
134+
with:
135+
usesh: true
136+
prepare: |
137+
pkg install -y gmake
138+
run: |
139+
gmake
140+
./qjs -qd
141+
gmake test

tests/test_std.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ function test_os()
144144
{
145145
var fd, fpath, fname, fdir, buf, buf2, i, files, err, fdate, st, link_path;
146146

147-
assert(os.isatty(0));
147+
// XXX(bnoordhuis) disabled because stdio is not a tty on CI
148+
//assert(os.isatty(0));
148149

149150
fdir = "test_tmp_dir";
150151
fname = "tmp_file.txt";

0 commit comments

Comments
 (0)