пришлось юзнуть ии что бы проверить jq потому что я хз как им пользоваться
This commit is contained in:
parent
4ace2e050b
commit
55f7c557c8
1 changed files with 24 additions and 19 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
name: compile bc
|
name: compile jq
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
@ -6,7 +6,7 @@ on:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
compile-bc:
|
compile-jq:
|
||||||
runs-on: archlinux-latest
|
runs-on: archlinux-latest
|
||||||
container:
|
container:
|
||||||
image: archlinux:latest
|
image: archlinux:latest
|
||||||
|
|
@ -14,25 +14,30 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: install packages and prepare source
|
- name: install packages and prepare source
|
||||||
run: |
|
run: |
|
||||||
pacman -Sy --noconfirm wget base-devel ed readline
|
pacman -Sy --noconfirm wget base-devel autoconf automake bison flex python
|
||||||
wget https://ftp.gnu.org/gnu/bc/bc-1.08.2.tar.gz
|
wget https://github.com/jqlang/jq/releases/download/jq-1.8.1/jq-1.8.1.tar.gz
|
||||||
tar -xf bc-1.08.2.tar.gz
|
tar -xf jq-1.8.1
|
||||||
|
|
||||||
- name: compile bc
|
- name: compile jq
|
||||||
run: |
|
run: |
|
||||||
cd bc-1.08.2
|
cd jq-1.8.1
|
||||||
./configure \
|
./configure --prefix=/usr
|
||||||
--prefix=/usr \
|
make -j$(nproc)
|
||||||
--mandir=/usr/share/man \
|
make prefix=/usr install
|
||||||
--infodir=/usr/share/info \
|
|
||||||
--with-readline
|
|
||||||
make -j1
|
|
||||||
make install
|
|
||||||
|
|
||||||
|
|
||||||
- name: run bc
|
- name: run jq
|
||||||
run: |
|
run: |
|
||||||
echo "2+2 = "
|
echo '[
|
||||||
echo "2+2" | bc
|
{"first": "first ok"},
|
||||||
echo "2+2*2 = "
|
{"second": "second ok"},
|
||||||
echo "2+2*2" | bc
|
{"third": "third ok"},
|
||||||
|
{"fourth": "fourth ok"},
|
||||||
|
{"fifth": "fifth ok"}
|
||||||
|
]' > test.json
|
||||||
|
echo "all"
|
||||||
|
jq '.[].first // .[].second // .[].third // .[].fourth // .[].fifth' test.json
|
||||||
|
echo "only object third"
|
||||||
|
jq '.[] | select(has("third"))' test.json
|
||||||
|
echo "only fourth"
|
||||||
|
jq '.[3].fourth' test.json
|
||||||
Loading…
Add table
Add a link
Reference in a new issue