пришлось юзнуть ии что бы проверить 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:
|
||||
push:
|
||||
|
|
@ -6,7 +6,7 @@ on:
|
|||
- main
|
||||
|
||||
jobs:
|
||||
compile-bc:
|
||||
compile-jq:
|
||||
runs-on: archlinux-latest
|
||||
container:
|
||||
image: archlinux:latest
|
||||
|
|
@ -14,25 +14,30 @@ jobs:
|
|||
steps:
|
||||
- name: install packages and prepare source
|
||||
run: |
|
||||
pacman -Sy --noconfirm wget base-devel ed readline
|
||||
wget https://ftp.gnu.org/gnu/bc/bc-1.08.2.tar.gz
|
||||
tar -xf bc-1.08.2.tar.gz
|
||||
pacman -Sy --noconfirm wget base-devel autoconf automake bison flex python
|
||||
wget https://github.com/jqlang/jq/releases/download/jq-1.8.1/jq-1.8.1.tar.gz
|
||||
tar -xf jq-1.8.1
|
||||
|
||||
- name: compile bc
|
||||
- name: compile jq
|
||||
run: |
|
||||
cd bc-1.08.2
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--mandir=/usr/share/man \
|
||||
--infodir=/usr/share/info \
|
||||
--with-readline
|
||||
make -j1
|
||||
make install
|
||||
cd jq-1.8.1
|
||||
./configure --prefix=/usr
|
||||
make -j$(nproc)
|
||||
make prefix=/usr install
|
||||
|
||||
|
||||
- name: run bc
|
||||
- name: run jq
|
||||
run: |
|
||||
echo "2+2 = "
|
||||
echo "2+2" | bc
|
||||
echo "2+2*2 = "
|
||||
echo "2+2*2" | bc
|
||||
echo '[
|
||||
{"first": "first ok"},
|
||||
{"second": "second ok"},
|
||||
{"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