-
Notifications
You must be signed in to change notification settings - Fork 3
43 lines (40 loc) · 1.23 KB
/
test_api.yml
File metadata and controls
43 lines (40 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Test API
on: [pull_request, push]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: github_actions
ports:
# Maps tcp port 5432 on service container to host
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis:latest
ports:
# Maps TCP port 6379 on the service container to host
- 6379:6379
steps:
- name: Checkout action
uses: actions/checkout@v2
- name: Setup Python3 action
uses: actions/setup-python@v5
with:
python-version: 3.10.5
# install test deps
- name: Install test deps
run: pip install -r src/roommatefinder/requirements/test.txt
# create sample_secrets.json
- name: Create sample_secrets.json
run: commands/__tests__/create_secrets.sh
# migrate
- name: Run migrations
run: python3 src/roommatefinder/manage.py migrate
# test api
- name: Run tests
run: commands/__tests__/run_tests_on_api.sh