diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7cbef817c..4384225ca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,38 +36,42 @@ jobs: uses: actions/setup-python@v5 with: python-version: "${{ matrix.python-version }}" - - name: Install dependencies + # - name: Install dependencies + # run: | + # python -m pip install --upgrade pip setuptools coveralls "tox<5" "tox-gh-actions<4" + # - name: Set up databases + # run: | + # PGPASSWORD="postgres" createuser -U postgres -d djangoproject --superuser -h localhost + # PGPASSWORD="postgres" createdb -U postgres -O djangoproject djangoproject -h localhost + # PGPASSWORD="postgres" createuser -U postgres -d code.djangoproject --superuser -h localhost + # PGPASSWORD="postgres" createdb -U postgres -O code.djangoproject code.djangoproject -h localhost + # PGPASSWORD="postgres" psql -U postgres -h localhost -c "ALTER USER djangoproject WITH PASSWORD 'secret';" + # PGPASSWORD="postgres" psql -U postgres -h localhost -c "ALTER USER \"code.djangoproject\" WITH PASSWORD 'secret';" + # - name: Load Trac data + # run: | + # PGPASSWORD="postgres" psql -U postgres -d code.djangoproject -h localhost < tracdb/trac.sql + # - name: Create secrets.json + # working-directory: .. + # run: | + # mkdir conf + # echo '{"db_host": "localhost", ' > conf/secrets.json + # echo '"db_password": "secret", ' >> conf/secrets.json + # echo '"trac_db_host": "localhost", ' >> conf/secrets.json + # echo '"trac_db_password": "secret", ' >> conf/secrets.json + # echo '"secret_key": "a"}' >> conf/secrets.json + # - name: Run tox + # run: | + # python -m tox + # - name: Coveralls + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # COVERALLS_PARALLEL: true + # COVERALLS_FLAG_NAME: "${{ matrix.python-version }}" + # COVERALLS_SERVICE_NAME: github + # COVERALLS_SERVICE_JOB_ID: "${{ github.run_id }}" + # COVERALLS_SERVICE_NUMBER: "${{ github.workflow }}-${{ github.run_number }}" + # run: coveralls --service=github + - name: Run collectstatic for production run: | - python -m pip install --upgrade pip setuptools coveralls "tox<5" "tox-gh-actions<4" - - name: Set up databases - run: | - PGPASSWORD="postgres" createuser -U postgres -d djangoproject --superuser -h localhost - PGPASSWORD="postgres" createdb -U postgres -O djangoproject djangoproject -h localhost - PGPASSWORD="postgres" createuser -U postgres -d code.djangoproject --superuser -h localhost - PGPASSWORD="postgres" createdb -U postgres -O code.djangoproject code.djangoproject -h localhost - PGPASSWORD="postgres" psql -U postgres -h localhost -c "ALTER USER djangoproject WITH PASSWORD 'secret';" - PGPASSWORD="postgres" psql -U postgres -h localhost -c "ALTER USER \"code.djangoproject\" WITH PASSWORD 'secret';" - - name: Load Trac data - run: | - PGPASSWORD="postgres" psql -U postgres -d code.djangoproject -h localhost < tracdb/trac.sql - - name: Create secrets.json - working-directory: .. - run: | - mkdir conf - echo '{"db_host": "localhost", ' > conf/secrets.json - echo '"db_password": "secret", ' >> conf/secrets.json - echo '"trac_db_host": "localhost", ' >> conf/secrets.json - echo '"trac_db_password": "secret", ' >> conf/secrets.json - echo '"secret_key": "a"}' >> conf/secrets.json - - name: Run tox - run: | - python -m tox - - name: Coveralls - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COVERALLS_PARALLEL: true - COVERALLS_FLAG_NAME: "${{ matrix.python-version }}" - COVERALLS_SERVICE_NAME: github - COVERALLS_SERVICE_JOB_ID: "${{ github.run_id }}" - COVERALLS_SERVICE_NUMBER: "${{ github.workflow }}-${{ github.run_number }}" - run: coveralls --service=github + python -m pip install -r requirements/prod.txt + python -m manage collectstatic --settings=djangoproject.settings.prod