Skip to content

Commit

Permalink
Add CI for legacy Cog tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nevillelyh committed Dec 11, 2024
1 parent d15c2e6 commit 5df9ea7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ jobs:
- uses: astral-sh/setup-uv@v3
- run: ./script/test.sh go

test-go-legacy-cog:
name: Test Go with legacy Cog
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v3
- run: ./script/test.sh go -legacy-cog

build-python:
name: Build & verify python package
runs-on: ubuntu-latest
Expand Down
32 changes: 16 additions & 16 deletions script/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@ base_dir="$(git rev-parse --show-toplevel)"
cd "$base_dir"

test_go() {
go test ./...
go test ./... "$@"
}

test_python() {
cd "$base_dir/python"
uv sync --all-extras
.venv/bin/pytest
.venv/bin/pytest "$@"
}

if [ $# -eq 0 ]; then
test_go
test_python
else
for c in "$@"; do
case "$c" in
go)
test_go
;;
python)
test_python
;;
*)
echo "Unknown test $c"
exit 1
;;
esac
done
t=$1
shift
case "$t" in
go)
test_go "$@"
;;
python)
test_python "$@"
;;
*)
echo "Unknown test $t"
exit 1
;;
esac
fi

0 comments on commit 5df9ea7

Please sign in to comment.