ci(release): run tests before publishing

Gate both publish jobs on the package's test suite: npm test
--if-present before the npm build/publish, and pytest (when a tests/
or test/ directory exists, matching python.yml's guard) before the
PyPI build/publish. Previously nothing between tagging and publishing
ran a single test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AViME1R9ES2UXT1uQDx1TG
This commit is contained in:
cliffhall 2026-07-04 10:01:31 -04:00
commit dab3489b73

View file

@ -138,6 +138,15 @@ jobs:
working-directory: src/${{ matrix.package }}
run: uv run --frozen pyright
- name: Run tests
working-directory: src/${{ matrix.package }}
run: |
if [ -d "tests" ] || [ -d "test" ]; then
uv run pytest
else
echo "No tests directory, skipping"
fi
- name: Build package
working-directory: src/${{ matrix.package }}
run: uv build
@ -189,6 +198,10 @@ jobs:
fi
echo "Version $VERSION is new, proceeding with publish"
- name: Run tests
working-directory: src/${{ matrix.package }}
run: npm test --if-present
- name: Build package
working-directory: src/${{ matrix.package }}
run: npm run build