Merge pull request #1150 from jhuopensource/rel/2025_10B #2105
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
# 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 |