parent
351ee6e078
commit
01019e307c
1 changed files with 7 additions and 30 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
name: compile jq
|
name: qwq
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
@ -6,38 +6,15 @@ on:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
compile-jq:
|
qwq:
|
||||||
runs-on: archlinux-latest
|
runs-on: archlinux-latest
|
||||||
container:
|
container:
|
||||||
image: archlinux:latest
|
image: archlinux:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: install packages and prepare source
|
- name: qwq
|
||||||
run: |
|
run: |
|
||||||
pacman -Sy --noconfirm wget base-devel autoconf automake bison flex python
|
lsblk
|
||||||
wget https://github.com/jqlang/jq/releases/download/jq-1.8.1/jq-1.8.1.tar.gz
|
df -h
|
||||||
tar -xf jq-1.8.1.tar.gz
|
whoami
|
||||||
|
uname -a
|
||||||
- name: compile jq
|
|
||||||
run: |
|
|
||||||
cd jq-1.8.1
|
|
||||||
./configure --prefix=/usr
|
|
||||||
make -j$(nproc)
|
|
||||||
make prefix=/usr install
|
|
||||||
|
|
||||||
|
|
||||||
- name: run jq
|
|
||||||
run: |
|
|
||||||
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