Skip to content

LF-4471: Add or update models for animal movement task #4315

LF-4471: Add or update models for animal movement task

LF-4471: Add or update models for animal movement task #4315

name: API Unit Tests
on:
pull_request:
branches:
- integration
- "patch/**"
jobs:
api_unit_tests:
name: API Unit Tests
runs-on: ubuntu-20.04
container: node:18.16.1
services:
postgres:
image: postgres:13
env:
POSTGRES_DB: "test_farm"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "pipeline"
POSTGRES_HOST: postgres
POSTGRES_PORT: 5432
ports:
- "5432:5432"
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 5
env:
JWT_INVITE_SECRET: ${{secrets.JWT_INVITE_SECRET}}
JWT_RESET_SECRET: ${{secrets.JWT_RESET_SECRET}}
JWT_SCHEDULER_SECRET: ${{secrets.JWT_SCHEDULER_SECRET}}
JWT_SECRET: ${{secrets.JWT_SECRET}}
TEST_USER: ${{secrets.TEST_USER}}
TEST_USER_ID: ${{secrets.TEST_USER_ID}}
steps:
# Checkout the current code in the repository
- name: Check out repository code
uses: actions/checkout@v3
# Install all the dependencies
- name: Install dependencies
run: cd packages/api && npm ci && cd ../shared && npm ci
# Run migrations on the database
- name: Setup database
run: cd packages/api && npm run migrate:pipeline:db
# Run all the CI tests
- name: Run tests
run: cd packages/api && npm run test-ci