diff --git a/.github/scripts/checknumtasks.sh b/.github/scripts/checknumtasks.sh new file mode 100755 index 0000000..19b1711 --- /dev/null +++ b/.github/scripts/checknumtasks.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +if [ "$#" -ne 2 ]; then + echo "Usage: ./checknumtasks.sh " + exit 1 +fi + +if [ "$1" -ne "$2" ]; then + echo "Number of tasks: $1; expected: $2" + exit 1 +fi + +echo "Actual and expected number of tasks match" diff --git a/.github/workflows/back-compat-pr.yml b/.github/workflows/back-compat-pr.yml index ef301b8..1653df3 100644 --- a/.github/workflows/back-compat-pr.yml +++ b/.github/workflows/back-compat-pr.yml @@ -22,21 +22,23 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 + with: + ref: main - name: Set up Go uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} - - name: build head - run: | - go build -o omm_head - cp omm_head /var/tmp - - uses: actions/checkout@v4 - with: - ref: main - name: build main run: | go build -o omm_main cp omm_main /var/tmp + rm omm_main + - uses: actions/checkout@v4 + - name: build head + run: | + go build -o omm_head + cp omm_head /var/tmp + rm omm_head - name: Run last version run: | /var/tmp/omm_main --db-path=/var/tmp/throwaway.db 'test: a task from main' @@ -44,3 +46,4 @@ jobs: run: | /var/tmp/omm_head --db-path=/var/tmp/throwaway.db 'test: a task from PR HEAD' /var/tmp/omm_head --db-path=/var/tmp/throwaway.db tasks + ./.github/scripts/checknumtasks.sh "$(/var/tmp/omm_head --db-path=/var/tmp/throwaway.db tasks | wc -l | xargs)" 2 diff --git a/.github/workflows/back-compat.yml b/.github/workflows/back-compat.yml index a0c677b..fa0c22f 100644 --- a/.github/workflows/back-compat.yml +++ b/.github/workflows/back-compat.yml @@ -21,20 +21,22 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 2 + - run: git checkout HEAD~1 - name: Set up Go uses: actions/setup-go@v5 with: go-version: ${{ env.GO_VERSION }} + - name: build last commit + run: | + go build -o omm_prev + cp omm_prev /var/tmp + rm omm_prev + - run: git checkout main - name: build head run: | go build -o omm_head cp omm_head /var/tmp rm omm_head - - run: git checkout HEAD~1 - - name: build main - run: | - go build -o omm_prev - cp omm_prev /var/tmp - name: Run last version run: | /var/tmp/omm_prev --db-path=/var/tmp/throwaway.db 'test: a task from previous commit' @@ -42,3 +44,4 @@ jobs: run: | /var/tmp/omm_head --db-path=/var/tmp/throwaway.db 'test: a task from main HEAD' /var/tmp/omm_head --db-path=/var/tmp/throwaway.db tasks + ./.github/scripts/checknumtasks.sh "$(/var/tmp/omm_head --db-path=/var/tmp/throwaway.db tasks | wc -l | xargs)" 2 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db57f29..934cbdf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,5 +35,7 @@ jobs: - name: run omm run: | go build . + cat assets/sample-tasks.txt | ./omm import ./omm 'test: a task' ./omm tasks + ./.github/scripts/checknumtasks.sh "$(./omm tasks | wc -l | xargs)" 11 diff --git a/assets/sample-tasks.txt b/assets/sample-tasks.txt new file mode 100644 index 0000000..d277953 --- /dev/null +++ b/assets/sample-tasks.txt @@ -0,0 +1,10 @@ +tech: Order new ACME rocket skates +traps: Draw fake tunnel on the canyon wall +tech: Check ACME catalog for new gadgets +tech: Test the giant slingshot +tech: Assemble ACME jet-propelled pogo stick +plan: Plan the next trap location +orders: Buy more bird seed for the bait +tech: Install spring-loaded boxing glove +order: Order a lifetime supply of ACME bird seed to lure Road Runner +traps: Paint a fake bridge over a dry riverbed diff --git a/cmd/assets/guide/actions-markdown-in-context.md b/cmd/assets/guide/actions-markdown-in-context.md index 4c0b1df..d2456cd 100644 --- a/cmd/assets/guide/actions-markdown-in-context.md +++ b/cmd/assets/guide/actions-markdown-in-context.md @@ -37,8 +37,6 @@ This is a URL: [omm](https://github.com/dhth/omm) --- > This is a block quote -> that spans -> multiple lines --- diff --git a/cmd/assets/guide/visuals-list-density.md b/cmd/assets/guide/visuals-list-density.md index 6170a81..2d29ba7 100644 --- a/cmd/assets/guide/visuals-list-density.md +++ b/cmd/assets/guide/visuals-list-density.md @@ -2,10 +2,9 @@ omm's task lists can be viewed in two density modes: **compact** and **spacious**. This is the compact mode. As opposed to this, the spacious mode shows tasks in a -more roomier list, alongside highlighting prefixes (we'll see what that means), -and showing creation timestamps. +more roomier list, alongside showing creation timestamps. -omm starts up with spacious mode by default (you can change this, as we'll see +omm starts up with compact mode by default (you can change this, as we'll see soon). You can toggle between the two modes by pressing `v`. Choose whichever mode fits your workflow better.