forked from noahpresler/semesterly
-
Notifications
You must be signed in to change notification settings - Fork 55
76 lines (66 loc) · 1.96 KB
/
semesterly.yml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Builds Semester.ly and runs tests
name: Semesterly CI
on:
push:
branches:
- prod
- develop
- feature/dark-mode-timetable
pull_request:
branches:
- prod
- develop
- feature/dark-mode-timetable
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
matrix:
python-version: [3.8]
node-version: [14.x]
steps:
- name: Adjust hosts file
run: sudo echo "127.0.0.1 jhu.sem.ly sem.ly jhu" | sudo tee -a /etc/hosts
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ hashFiles('requirements.txt') }}
- name: Install Python Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm install
- run: npm -g install chromedriver
- run: npm -g install jest@20
- run: npm run build --if-present
- run: npm run lint
- run: npm run test
- name: Run Backend Tests
env:
NODE_ENV: production
host: jhu.sem.ly
DB_PORT: ${{ job.services.postgres.ports[5432] }}
run: python manage.py test
- name: Run docs
run: make html -C docs