[CL-99] Get all cats in radius #90
Workflow file for this run
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: Run Tests | |
on: | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout latest code | |
uses: actions/checkout@v4 | |
- name: Setup Node ENV | |
uses: actions/setup-node@v4 | |
- name: Build Docker instance | |
run: npm run setup-db | |
- name: Get Docker container ID | |
id: docker-id | |
run: echo ID=$(docker ps -aqf "name=psql") >> "$GITHUB_OUTPUT" | |
- name: Get Docker container IP | |
id: docker-ip | |
run: echo IP=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' ${{ steps.docker-id.outputs.ID }}) >> "$GITHUB_OUTPUT" | |
- name: Install Packages | |
run: npm ci | |
- name: Seed database | |
run: npx prisma migrate dev && npx prisma db seed | |
env: | |
DATABASE_URL: 'postgresql://root:root@${{steps.docker-ip.outputs.IP}}:5432/clowder' | |
- name: Run Tests | |
run: npm test | |
env: | |
DATABASE_URL: 'postgresql://root:root@${{steps.docker-ip.outputs.IP}}:5432/clowder' |