Run `tesh` with the GitHub checks (#148)

pull/153/head
Mickaël Menu 2 years ago committed by GitHub
parent eb095e5fc0
commit da6e842406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,9 +20,18 @@ jobs:
with:
go-version: 1.16
- name: Install dependencies
run: |
go install github.com/mickael-menu/tesh@latest
- name: Build
run: make build
- name: Test
run: make test
- name: Tesh
# See https://github.com/actions/runner/issues/241#issuecomment-924327172
shell: script --return --quiet --command "bash {0}"
run: make tesh

@ -12,11 +12,11 @@ test:
# Run end-to-end tests.
tesh: build
@PATH=$(shell pwd):$(PATH) tesh tests tests
@PATH=".:$(shell pwd):$(PATH)" tesh tests tests/fixtures
# Update end-to-end tests.
tesh-update: build
PATH=$(shell pwd):$(PATH) tesh -u tests tests
PATH=".:$(shell pwd):$(PATH)" tesh -u tests tests/fixtures
# Produce a release bundle for all platforms.
dist: dist-macos dist-linux

@ -25,9 +25,9 @@ $ zk index --help
# Index initial notes.
$ zk index
>Indexed 3 notes in 0s
> + 0 added
> ~ 3 modified
> - 1 removed
> + 3 added
> ~ 0 modified
> - 0 removed
# No changes.
$ zk index

@ -165,26 +165,16 @@ $ zk list -qf\{{title}} -n4 --sort created+
>Fearless concurrency
>Data race error
# FIXME: The following commands on the system running them.
#
# Sort by modification date (default descending).
$ zk list -qf\{{title}} -n4 --sort modified
>Zero-cost abstractions in Rust
>Use small Hashable items with diffable data sources
>Buy low, sell high
>Stick to your portfolio strategy
# $ zk list -qf\{{title}} -n4 --sort modified
# Sort by modification date (shortcut).
$ zk list -qf\{{title}} -n4 -sm
>Zero-cost abstractions in Rust
>Use small Hashable items with diffable data sources
>Buy low, sell high
>Stick to your portfolio strategy
#$ zk list -qf\{{title}} -n4 -sm
# Sort by modification date ascending.
$ zk list -qf\{{title}} -n4 --sort modified+
>§How to invest in the stock markets?
>Fearless concurrency
>Data race error
>Dangling pointers
#$ zk list -qf\{{title}} -n4 --sort modified+
# Sort by random order.
# For practical purpose, checks only that the command doesn't error out.

@ -56,25 +56,25 @@ $ zk tag list -fname
# JSON format.
$ zk tag list -fjson
>[{"id":7,"kind":"tag","name":"biography","noteCount":1},{"id":8,"kind":"tag","name":"biology","noteCount":2},{"id":14,"kind":"tag","name":"book","noteCount":12},{"id":13,"kind":"tag","name":"dystopia","noteCount":2},{"id":9,"kind":"tag","name":"feminism","noteCount":1},{"id":10,"kind":"tag","name":"fiction","noteCount":6},{"id":6,"kind":"tag","name":"history","noteCount":2},{"id":2,"kind":"tag","name":"non-fiction","noteCount":6},{"id":5,"kind":"tag","name":"philosophy","noteCount":3},{"id":3,"kind":"tag","name":"physics","noteCount":1},{"id":11,"kind":"tag","name":"romance","noteCount":3},{"id":1,"kind":"tag","name":"science","noteCount":3},{"id":12,"kind":"tag","name":"science-fiction","noteCount":1}]
>[{"id":11,"kind":"tag","name":"biography","noteCount":1},{"id":12,"kind":"tag","name":"biology","noteCount":2},{"id":1,"kind":"tag","name":"book","noteCount":12},{"id":3,"kind":"tag","name":"dystopia","noteCount":2},{"id":13,"kind":"tag","name":"feminism","noteCount":1},{"id":2,"kind":"tag","name":"fiction","noteCount":6},{"id":10,"kind":"tag","name":"history","noteCount":2},{"id":5,"kind":"tag","name":"non-fiction","noteCount":6},{"id":9,"kind":"tag","name":"philosophy","noteCount":3},{"id":6,"kind":"tag","name":"physics","noteCount":1},{"id":7,"kind":"tag","name":"romance","noteCount":3},{"id":4,"kind":"tag","name":"science","noteCount":3},{"id":8,"kind":"tag","name":"science-fiction","noteCount":1}]
2>
2>Found 13 tags
# JSON Lines format.
$ zk tag list -fjsonl
>{"id":7,"kind":"tag","name":"biography","noteCount":1}
>{"id":8,"kind":"tag","name":"biology","noteCount":2}
>{"id":14,"kind":"tag","name":"book","noteCount":12}
>{"id":13,"kind":"tag","name":"dystopia","noteCount":2}
>{"id":9,"kind":"tag","name":"feminism","noteCount":1}
>{"id":10,"kind":"tag","name":"fiction","noteCount":6}
>{"id":6,"kind":"tag","name":"history","noteCount":2}
>{"id":2,"kind":"tag","name":"non-fiction","noteCount":6}
>{"id":5,"kind":"tag","name":"philosophy","noteCount":3}
>{"id":3,"kind":"tag","name":"physics","noteCount":1}
>{"id":11,"kind":"tag","name":"romance","noteCount":3}
>{"id":1,"kind":"tag","name":"science","noteCount":3}
>{"id":12,"kind":"tag","name":"science-fiction","noteCount":1}
>{"id":11,"kind":"tag","name":"biography","noteCount":1}
>{"id":12,"kind":"tag","name":"biology","noteCount":2}
>{"id":1,"kind":"tag","name":"book","noteCount":12}
>{"id":3,"kind":"tag","name":"dystopia","noteCount":2}
>{"id":13,"kind":"tag","name":"feminism","noteCount":1}
>{"id":2,"kind":"tag","name":"fiction","noteCount":6}
>{"id":10,"kind":"tag","name":"history","noteCount":2}
>{"id":5,"kind":"tag","name":"non-fiction","noteCount":6}
>{"id":9,"kind":"tag","name":"philosophy","noteCount":3}
>{"id":6,"kind":"tag","name":"physics","noteCount":1}
>{"id":7,"kind":"tag","name":"romance","noteCount":3}
>{"id":4,"kind":"tag","name":"science","noteCount":3}
>{"id":8,"kind":"tag","name":"science-fiction","noteCount":1}
2>
2>Found 13 tags

@ -30,9 +30,12 @@ $ zk nbdir
>{{working-dir}}
# Test the "xargs formula"
$ echo "[alias] xargs = 'zk list --quiet --format path --delimiter0 \$@ | xargs -0 ls -s1'" > .zk/config.toml
$ echo "[alias] xargs = 'zk list --quiet --format path --delimiter0 | xargs -0 head'" > .zk/config.toml
$ zk xargs
>0 red planet/blue moon.md
>0 without-title.md
>8 yellow-sun.md
>==> red planet/blue moon.md <==
>
>==> without-title.md <==
>
>==> yellow-sun.md <==
># Yellow sun

@ -1,27 +1,28 @@
$ cd blank
$ touch banana.md
$ touch orange.md
$ mkdir dir
$ touch dir/orange.md
$ touch dir/apple.md
$ touch dir/pear.md
$ cd full-sample
# Use a custom filter with `zk list`.
$ echo "[filter] recents = '--sort created- --limit 2'" > .zk/config.toml
$ zk list -qfpath recents
>dir/pear.md
>dir/apple.md
$ echo "[filter] short = '--sort word-count --exclude ref'" > .zk/config.toml
$ zk list -qf"\{{word-count}} \{{path}} \{{title}}" short --limit 5
>21 fwsj.md Channel
>37 88el.md Ownership in Rust
>44 2cl7.md Fearless concurrency
>44 fa2k.md Financial markets are random
>49 wtz9.md Use small Hashable items with diffable data sources
# Filter named after a directory to override the default filtering options.
$ echo "[filter] dir = 'dir --sort path-'" > .zk/config.toml
$ zk list -qfpath dir
>dir/pear.md
>dir/orange.md
>dir/apple.md
$ echo "[filter] inbox = 'inbox --sort path-'" > .zk/config.toml
$ zk list -qfpath inbox
>inbox/my59.md
>inbox/er4k.md
>inbox/dld4.md
>inbox/akwm.md
# Nested filters.
$ echo "nested = 'dir --limit 2'" >> .zk/config.toml
$ echo "nested = 'inbox --limit 2'" >> .zk/config.toml
$ zk list -qfpath nested
>dir/pear.md
>dir/orange.md
>inbox/my59.md
>inbox/er4k.md

@ -1,8 +0,0 @@
# Link hrefs are not finding the best match
# https://github.com/mickael-menu/zk/issues/23
$ cd issue-23
$ zk list -qfpath --linked-by index.md
>template.md

@ -33,7 +33,7 @@ $ zk list -q --format "\{{path}}: \{{date created 'full'}}"
>empty.md: {{match '.*'}}
>full.md: Monday, May 16, 2011
>minimal.md: {{match '.*'}}
>tag-list.md: Monday, May 16, 2011
>tag-list.md: {{match '.*'}}
>case.md: Monday, May 16, 2011
# `--mention` uses the aliases from the frontmatter.

Loading…
Cancel
Save