chore: add automatic release with release-it
#2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Jest Tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Start test server | |
run: npm run start:test & | |
# Run in background and continue | |
- name: Wait for server to be ready | |
run: | | |
timeout=30 | |
while ! nc -z localhost 4004; do | |
if [ $timeout -le 0 ]; then | |
echo "Timeout waiting for server to start" | |
exit 1 | |
fi | |
timeout=$((timeout-1)) | |
sleep 1 | |
done | |
- name: Run tests | |
run: npm test |