Upgraded Python to v3.11.8 #174
This file contains hidden or 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
| name: Continuous Integration | |
| on: | |
| push: | |
| branches: [ 'master' ] | |
| pull_request: | |
| branches: [ 'master' ] | |
| jobs: | |
| test_DRF: | |
| name: Django Rest Framework CI | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:9.6 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: pulseapi | |
| ports: | |
| - 5432:5432 | |
| options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| env: | |
| DEBUG: True | |
| REDIRECT_URIS: http://test.example.com:8000/api/pulse/oauth2callback | |
| SSL_PROTECTION: False | |
| DATABASE_URL: postgres://postgres:postgres@localhost:5432/pulseapi | |
| SECRET_KEY: BetPHpGoUXUwjaAXm6ArIhV95xLdDZtu8QEGnNXY3eTknIkD | |
| AUTH_STAFF_EMAIL_DOMAINS: mozillafoundation.org | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.11 | |
| - name: Write .env file with DATABASE_URL for CI | |
| run: | | |
| echo "DATABASE_URL=postgres://postgres:postgres@localhost:5432/pulseapi" > .env | |
| # Pillow requires libjpeg-dev, zlib1g-dev, etc. to build from source | |
| - name: Install system dependencies for Pillow build | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libjpeg-dev zlib1g-dev libpng-dev | |
| # setuptools >=66 removed `convert_path`, which breaks django-allauth 0.48.0 | |
| # See https://github.com/pypa/setuptools/issues/3772 | |
| - name: Install setuptools 65.5.1 for compatibility with django-allauth | |
| run: pip install "setuptools==65.5.1" | |
| - name: Install wheel for building packages like cffi | |
| run: pip install wheel | |
| - name: Install Python Dependencies (no build isolation) | |
| run: | | |
| pip install --no-binary psycopg2-binary psycopg2-binary | |
| pip install --no-build-isolation -r requirements.txt -r dev-requirements.txt | |
| python manage.py migrate | |
| - name: Run Tests | |
| run: | | |
| flake8 pulseapi | |
| python manage.py test |