Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jaq support #20

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
23 changes: 14 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,34 @@ jobs:
- run: |
curl -sOLJ 'https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64'
chmod a+x jq-linux-amd64
make test-jq JQ=./jq-linux-amd64
JQ=./jq-linux-amd64 make test-jq

test-jqjq-jq:
name: Run tests with jqjq using jq
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# does PATH tricks so that jq that runs invoke_client_jqjq is same jq
- run: |
curl -sOLJ 'https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64'
mv jq-linux-amd64 jq
chmod a+x jq
PATH="$PWD:$PATH" make test-jqjq JQ=jq
chmod a+x jq-linux-amd64
JQ=./jq-linux-amd64 make test-jqjq

test-jqjq-gojq:
name: Run tests with jqjq using gojq
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
curl -sOLJ 'https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-amd64'
mv jq-linux-amd64 jq
chmod a+x jq
curl -Ls 'https://github.com/itchyny/gojq/releases/download/v0.12.16/gojq_v0.12.16_linux_amd64.tar.gz' | tar xz
mv gojq*/gojq gojq
PATH="$PWD:$PATH" make test-jqjq JQ=gojq
JQ=./gojq make test-jqjq

test-jqjq-jaq:
name: Run tests with jqjq using jaq
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
curl -sOLJ 'https://github.com/01mf02/jaq/releases/download/v2.0.0-epsilon/jaq-x86_64-unknown-linux-gnu'
chmod a+x jaq-x86_64-unknown-linux-gnu
JQ=./jaq-x86_64-unknown-linux-gnu make test-jqjq
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JQ=jq
JQ ?= jq

test: test-jq test-jqjq

Expand All @@ -8,4 +8,4 @@ test-jq:

.PHONY: test-jqjq
test-jqjq:
./jqjq --jq "${JQ}" --run-tests < jqjq.test
./jqjq --run-tests < jqjq.test
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,7 @@ Note that the tests are meant to be used with jq 1.7.1.
- [x] gojq
- [x] jqjq
- Used to work but runs out of memory on my laptop
- [ ] jaq
- Fails on missing destructing support
- [x] jaq
- [ ] xq
- Fails on missing `debug`, maths, jqjq `lex` returns empty (regexp issues?)
- [x] Bugs
Expand Down
2 changes: 1 addition & 1 deletion jqjq
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
eval "$(
jq \
"${JQ:=jq}" \
-nr \
-L "$(dirname "$(realpath "${BASH_SOURCE[0]}")")" \
'include "jqjq"; $ARGS.positional | invoke_client_jqjq' \
Expand Down
Loading
Loading