Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test github action for collectstatic #1836

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 38 additions & 34 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading