summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitattributes1
-rw-r--r--.github/workflows/linux.yml70
-rw-r--r--.github/workflows/macos.yml62
-rw-r--r--.github/workflows/scanbuild.yml77
-rw-r--r--.github/workflows/windows.yml45
-rw-r--r--README.md6
m---------modules/oniguruma0
-rw-r--r--tests/jq.test2
8 files changed, 261 insertions, 2 deletions
diff --git a/.gitattributes b/.gitattributes
index 59661532..366d3c2b 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,2 +1,3 @@
.gitattributes export-ignore
.gitignore export-ignore
+* text=auto eol=lf
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
new file mode 100644
index 00000000..8c38da91
--- /dev/null
+++ b/.github/workflows/linux.yml
@@ -0,0 +1,70 @@
+name: Linux Build
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+jobs:
+ linux:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ name: [linux-clang, linux-gcc]
+ include:
+ - name: linux-clang
+ os: ubuntu-22.04
+ compiler: clang
+ cflags: ''
+ - name: linux-gcc
+ os: ubuntu-22.04
+ compiler: gcc
+ cflags: '-Wnonnull'
+ steps:
+ - name: Clone repository
+ uses: actions/checkout@v3
+ with:
+ submodules: true
+ - name: Install packages
+ run: |
+ sudo apt-get update -qq
+ sudo apt-get install -y \
+ automake \
+ autoconf \
+ bison \
+ flex \
+ gdb \
+ python3 \
+ valgrind
+ - name: Build
+ env:
+ CC: ${{ matrix.compiler }}
+ MAKEVARS: ${{ matrix.makevars }}
+ run: |
+ autoreconf -fi
+ rm src/lexer.c src/lexer.h
+ rm src/parser.c src/parser.h
+ ./configure --disable-valgrind --with-oniguruma=builtin YACC="$(which bison) -y" $COVERAGE
+ make -j4
+ make dist
+ - name: Test
+ env:
+ CC: ${{ matrix.compiler }}
+ MAKEVARS: ${{ matrix.makevars }}
+ run: |
+ ulimit -c unlimited
+ make -j4 check
+ - name: Upload Test Logs
+ if: ${{ failure() }}
+ uses: actions/upload-artifact@v3
+ with:
+ name: test-logs
+ path: |
+ test-suite.log
+ tests/*.log
+ - name: Upload Artifacts
+ uses: actions/upload-artifact@v3
+ with:
+ name: jq-${{ matrix.name }}
+ path: |
+ jq
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
new file mode 100644
index 00000000..aa2c1847
--- /dev/null
+++ b/.github/workflows/macos.yml
@@ -0,0 +1,62 @@
+name: MacOS Build
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+jobs:
+ macos:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ name: [macos-12-clang, macos-13-clang]
+ include:
+ - name: macos-12-clang
+ os: macos-12
+ compiler: clang
+ - name: macos-13-clang
+ os: macos-13
+ compiler: clang
+ steps:
+ - name: Clone repository
+ uses: actions/checkout@v3
+ with:
+ submodules: true
+ - name: Install packages
+ run: |
+ brew update
+ brew install autoconf automake libtool flex bison python3
+ sed -i.bak '/^AM_INIT_AUTOMAKE(\[-Wno-portability 1\.14\])$/s/14/11/' modules/oniguruma/configure.ac
+ - name: Build
+ env:
+ CC: ${{ matrix.compiler }}
+ MAKEVARS: ${{ matrix.makevars }}
+ run: |
+ autoreconf -fi
+ rm src/lexer.c src/lexer.h
+ rm src/parser.c src/parser.h
+ ./configure --disable-valgrind --with-oniguruma=builtin YACC="$(brew --prefix)/opt/bison/bin/bison -y" $COVERAGE
+ make -j4
+ make dist
+ - name: Test
+ env:
+ CC: ${{ matrix.compiler }}
+ MAKEVARS: ${{ matrix.makevars }}
+ run: |
+ ulimit -c unlimited
+ make -j4 check
+ - name: Upload Test Logs
+ if: ${{ failure() }}
+ uses: actions/upload-artifact@v3
+ with:
+ name: test-logs
+ path: |
+ test-suite.log
+ tests/*.log
+ - name: Upload Artifacts
+ uses: actions/upload-artifact@v3
+ with:
+ name: jq-${{ matrix.name }}
+ path: |
+ jq
diff --git a/.github/workflows/scanbuild.yml b/.github/workflows/scanbuild.yml
new file mode 100644
index 00000000..6247a7da
--- /dev/null
+++ b/.github/workflows/scanbuild.yml
@@ -0,0 +1,77 @@
+name: Linux Clang scan-build Static Analyzer Build
+
+on:
+ # Don't do this for PRs. It eats up minutes.
+ push:
+ branches:
+ - 'master'
+ - 'scan-build'
+ paths:
+ - '.github/workflows/scanbuild.yml'
+
+jobs:
+ unix:
+ runs-on: ${{ matrix.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ name: [linux-clang]
+ include:
+ - name: linux-clang
+ os: ubuntu-18.04
+ compiler: clang
+ cflags: ''
+ steps:
+ - name: Clone repository
+ uses: actions/checkout@v1
+ - name: Open Submodule(s)
+ run: |
+ git submodule update --init --recursive
+ - name: Install packages
+ if: startsWith(matrix.os, 'ubuntu')
+ run: |
+ sudo apt-get update -qq
+ sudo apt-get install -y automake autoconf bison flex gdb python valgrind clang-tools
+ - name: Prep
+ run: |
+ #pyenv global 3.6.7
+ #pip3 install pipenv
+ #(cd docs && pipenv sync)
+ #if [ -n "$COVERAGE" ]; then pip install --user cpp-coveralls; fi
+ echo SHELL=$SHELL
+ echo PATH=$PATH
+ which bison
+ bison --version
+
+ - name: Build
+ env:
+ CC: ${{ matrix.compiler }}
+ MAKEVARS: ${{ matrix.makevars }}
+ run: |
+ autoreconf -fi
+ rm src/lexer.c src/lexer.h
+ rm src/parser.c src/parser.h
+ ./configure --with-oniguruma=builtin YACC="$(which bison) -y" $COVERAGE
+ scan-build --keep-going make -j4
+ - name: Test
+ env:
+ CC: ${{ matrix.compiler }}
+ MAKEVARS: ${{ matrix.makevars }}
+ run: |
+ ulimit -c unlimited
+ scan-build --keep-going make -j4 check
+ - name: Core dump stacks
+ run: |
+ echo "thread apply all bt" > /tmp/x
+ find . -name core -print | while read core; do gdb -batch -x x `file "$core"|sed -e "s/^[^']*'//" -e "s/[ '].*$//"` "$core"; done
+ if [ "$(find . -name core -print | wc -l)" -gt 0 ]; then false; fi
+ - name: Test logs
+ if: ${{ failure() }}
+ run: |
+ cat test-suite.log
+ cat tests/*.log
+ - name: Upload Logs
+ uses: actions/upload-artifact@v2
+ with:
+ name: Scan-Build Reports
+ path: '/tmp/scan-build*/'
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
new file mode 100644
index 00000000..04e0c8ec
--- /dev/null
+++ b/.github/workflows/windows.yml
@@ -0,0 +1,45 @@
+name: Windows Build
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+jobs:
+ windows:
+ runs-on: windows-latest
+ steps:
+ - name: Clone repository
+ uses: actions/checkout@v3
+ with:
+ submodules: true
+ - uses: msys2/setup-msys2@v2
+ with:
+ update: true
+ install: >-
+ base-devel
+ git
+ clang
+ autoconf
+ automake
+ libtool
+ p7zip
+ - shell: msys2 {0}
+ run: |
+ autoreconf -fiv
+ ./configure --disable-valgrind --with-oniguruma=builtin --disable-shared --enable-static --enable-all-static
+ make -j4
+ make SUBDIRS= "TESTS=tests/mantest tests/jqtest tests/onigtest tests/base64test" check
+ - name: Upload Test Logs
+ if: ${{ failure() }}
+ uses: actions/upload-artifact@v3
+ with:
+ name: test-logs
+ path: |
+ test-suite.log
+ tests/*.log
+ - name: Upload Artifacts
+ uses: actions/upload-artifact@v3
+ with:
+ name: jq-windows
+ path: |
+ jq.exe
diff --git a/README.md b/README.md
index 44acd13b..2388e318 100644
--- a/README.md
+++ b/README.md
@@ -72,4 +72,8 @@ cross-compilation environment. See also
["Cross compilation"](https://github.com/jqlang/jq/wiki/Cross-compilation) on
the wiki.
-Send questions to https://stackoverflow.com/questions/tagged/jq or to the #jq channel (https://web.libera.chat/#jq) on Libera.Chat (https://libera.chat/).
+
+# Community
+
+* Send questions to https://stackoverflow.com/questions/tagged/jq.
+* Join our [Discord server](https://discord.gg/yg6yjNmgAC).
diff --git a/modules/oniguruma b/modules/oniguruma
-Subproject 6fa38f4084b448592888ed9ee43c6e90a46b5f5
+Subproject 5a24a49d710a9e3bb8ff11d12e1eae5a9f9df40
diff --git a/tests/jq.test b/tests/jq.test
index 2d5c36b8..9aa435a2 100644
--- a/tests/jq.test
+++ b/tests/jq.test
@@ -1565,7 +1565,7 @@ try (1%.) catch .
jq: error: Division by zero? at <top-level>, line 1:
# Basic numbers tests: integers, powers of two
-[range(-52;52;1)] as $powers | [$powers[]|pow(2;.)|log2] == $powers
+[range(-52;52;1)] as $powers | [$powers[]|pow(2;.)|log2|round] == $powers
null
true