Skip to content

Commit

Permalink
ci: add more assertions (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhth committed Aug 13, 2024
1 parent 678f0ac commit 1195f43
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 17 deletions.
13 changes: 13 additions & 0 deletions .github/scripts/checknumtasks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

if [ "$#" -ne 2 ]; then
echo "Usage: ./checknumtasks.sh <actual_num_tasks> <expected_num_tasks> "
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"
17 changes: 10 additions & 7 deletions .github/workflows/back-compat-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,28 @@ 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'
- name: Run current version
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
13 changes: 8 additions & 5 deletions .github/workflows/back-compat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,27 @@ 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'
- name: Run current version
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
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions assets/sample-tasks.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions cmd/assets/guide/actions-markdown-in-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ This is a URL: [omm](https://github.com/dhth/omm)
---

> This is a block quote
> that spans
> multiple lines
---

Expand Down
5 changes: 2 additions & 3 deletions cmd/assets/guide/visuals-list-density.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 1195f43

Please sign in to comment.