ci: add linux build+test workflow (#2)

This commit is contained in:
Ben Noordhuis 2023-10-31 18:01:52 +01:00 committed by GitHub
parent 2788d71e82
commit 2f7fd38f68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 2 deletions

31
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,31 @@
name: ci
on:
pull_request:
paths:
- '**'
- '!LICENSE'
- '!TODO'
- '!doc/**'
- '!examples/**'
- '.github/workflows/ci.yml'
push:
branches:
- master
# TODO(bnoordhuis) run test262 tests
jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: build
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y
- name: stats
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y qjs
./qjs -qd
- name: test
run: |
make -j$(getconf _NPROCESSORS_ONLN) CONFIG_WERROR=y test

8
.gitignore vendored Normal file
View file

@ -0,0 +1,8 @@
examples/point.so
.obj/
qjs
qjs32
qjsc
qjscalc.c
repl.c
tests/bjson.so

View file

@ -28,7 +28,8 @@ endif
# Windows cross compilation from Linux # Windows cross compilation from Linux
#CONFIG_WIN32=y #CONFIG_WIN32=y
# use link time optimization (smaller and faster executables but slower build) # use link time optimization (smaller and faster executables but slower build)
CONFIG_LTO=y # XXX(bnoordhuis) disabled because of slow build times
#CONFIG_LTO=y
# consider warnings as errors (for development) # consider warnings as errors (for development)
#CONFIG_WERROR=y #CONFIG_WERROR=y
# force 32 bit build for some utilities # force 32 bit build for some utilities

View file

@ -143,7 +143,8 @@ function test_os()
{ {
var fd, fpath, fname, fdir, buf, buf2, i, files, err, fdate, st, link_path; 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"; fdir = "test_tmp_dir";
fname = "tmp_file.txt"; fname = "tmp_file.txt";