Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Lint build script
run: |
bash -n build.sh
command -v shellcheck >/dev/null 2>&1 || brew install shellcheck
shellcheck -S error build.sh

- name: Validate Info.plist
run: plutil -lint Info.plist
- name: Ensure shellcheck is installed
run: command -v shellcheck >/dev/null 2>&1 || brew install shellcheck

- name: Typecheck make_icon.swift
run: swiftc -typecheck -swift-version 5 -warn-concurrency make_icon.swift
- name: Run test suite and strict checks
run: ./scripts/test.sh

- name: Build and verify app bundle
run: |
Expand Down
26 changes: 26 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -euo pipefail

cd "$(dirname "${BASH_SOURCE[0]}")/.."

echo "==> Checking shell scripts"
bash -n build.sh scripts/test.sh
if command -v shellcheck >/dev/null 2>&1; then
shellcheck -S error build.sh scripts/test.sh
fi

echo "==> Validating Info.plist"
plutil -lint Info.plist

echo "==> Typechecking Swift sources (strict concurrency)"
swiftc -typecheck -swift-version 5 -warn-concurrency -warnings-as-errors Core.swift main.swift
swiftc -typecheck -swift-version 5 -warn-concurrency -warnings-as-errors make_icon.swift

echo "==> Running Swift CoreTests"
TMP_BIN="$(mktemp "${TMPDIR:-/tmp}/twoup-core-tests.XXXXXX")"
trap 'rm -f "$TMP_BIN"' EXIT
swiftc -swift-version 5 -warn-concurrency -warnings-as-errors Core.swift tests/CoreTests.swift -o "$TMP_BIN"
"$TMP_BIN"

echo "==> Running Node reader tests"
node --test tests/reader.test.mjs
Loading
Loading