Lous list open seats #2252
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
# Based on https://github.com/actions/starter-workflows/blob/main/ci/django.yml | |
name: Continuous Integration | |
on: | |
pull_request: | |
branches: | |
- "*" | |
# The following is needed to run tests upon direct push to dev or master | |
push: | |
branches: [dev, master] | |
env: | |
PYTHON_TARGET: 3.11 | |
# Django | |
DJANGO_SETTINGS_MODULE: tcf_core.settings.ci | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
DEBUG: 1 | |
# database | |
DB_NAME: tcf_db # arbitrary string | |
DB_USER: postgres # default user | |
DB_PASSWORD: postgres # default password | |
DB_HOST: localhost # required for GitHub Actions | |
DB_PORT: 5432 # default port | |
# social-auth-app-django | |
SOCIAL_AUTH_GOOGLE_OAUTH2_KEY: ${{ secrets.SOCIAL_AUTH_GOOGLE_OAUTH2_KEY }} | |
SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET: ${{ secrets.SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET }} | |
# email for account verification | |
EMAIL_HOST_USER: ${{ secrets.EMAIL_HOST_USER }} | |
EMAIL_HOST_PASSWORD: ${{ secrets.EMAIL_HOST_PASSWORD }} | |
# review drive account information | |
REVIEW_DRIVE_ID: ${{ secrets.REVIEW_DRIVE_ID }} | |
REVIEW_DRIVE_EMAIL: ${{ secrets.REVIEW_DRIVE_EMAIL }} | |
REVIEW_DRIVE_PASSWORD: ${{ secrets.REVIEW_DRIVE_PASSWORD }} | |
jobs: | |
pylint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ env.PYTHON_TARGET }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ env.PYTHON_TARGET }} | |
- name: Install Python packages, excluding the unnecessary ones | |
run: | | |
python -m pip install --upgrade pip | |
sed -i '/\(coverage\|types\-tqdm\|black\|isort\|gunicorn\|django\-heroku\|uwsgi\)/d' requirements.txt | |
pip install -r requirements.txt | |
- name: Run pylint | |
run: | | |
export PYTHONPATH="$(pwd)" | |
pylint --django-settings-module=${{ env.DJANGO_SETTINGS_MODULE }} --jobs=0 --load-plugins pylint_django tcf_website tcf_core | |
django: | |
runs-on: ubuntu-latest | |
outputs: | |
code-coverage: ${{ steps.coverage.outputs.percentage }} | |
services: | |
postgres: | |
image: postgres:15.4 | |
env: | |
POSTGRES_USER: ${{ env.DB_USER}} | |
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }} | |
POSTGRES_DB: ${{ env.DB_NAME }} | |
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 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ env.PYTHON_TARGET }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ env.PYTHON_TARGET }} | |
- name: Install Python packages, excluding the unnecessary ones | |
run: | | |
python -m pip install --upgrade pip | |
sed -i '/\(lint\|mypy\|types\-tqdm\|black\|isort\|gunicorn\|django\-heroku\|django\-stubs\|uwsgi\)/d' requirements.txt | |
pip install -r requirements.txt | |
- name: Migrations & Tests | |
run: | | |
envsubst < .config/.env.example > .env | |
python manage.py migrate | |
coverage run manage.py test | |
- name: Get code coverage | |
id: coverage | |
run: | | |
echo "::set-output name=percentage::$(coverage report | grep -o '[0-9]\+%' | tail -1)" | |
eslint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Node | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 20 | |
- name: Install npm packages | |
run: npm ci | |
- name: Run ESLint | |
run: npx eslint -c .config/.eslintrc.yml tcf_website/static/ |