From c0f2555baa270ff8dd899da78a2553b27f5fb537 Mon Sep 17 00:00:00 2001 From: ontowhee <82607723+ontowhee@users.noreply.github.com> Date: Wed, 18 Dec 2024 21:41:37 -0800 Subject: [PATCH 1/3] Add collectstatic command to tox tests --- tox.ini | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index d8f31f0b9..a76e2727e 100644 --- a/tox.ini +++ b/tox.ini @@ -14,7 +14,9 @@ deps = flake8: flake8 isort: isort commands = - tests: make ci + tests: + make ci + python manage.py collectstatic --settings=djangoproject.settings.prod flake8: flake8 isort: make isort-check From 16502f79dffb152097b726e87ae293323e702af1 Mon Sep 17 00:00:00 2001 From: ontowhee <82607723+ontowhee@users.noreply.github.com> Date: Wed, 18 Dec 2024 22:11:51 -0800 Subject: [PATCH 2/3] Try github workflow step --- .github/workflows/tests.yml | 4 ++++ tox.ini | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7cbef817c..df28ddc19 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -71,3 +71,7 @@ jobs: 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 -r requirements/prod.txt + python -m manage collectstatic --djangoproject.settings.prod diff --git a/tox.ini b/tox.ini index a76e2727e..d8f31f0b9 100644 --- a/tox.ini +++ b/tox.ini @@ -14,9 +14,7 @@ deps = flake8: flake8 isort: isort commands = - tests: - make ci - python manage.py collectstatic --settings=djangoproject.settings.prod + tests: make ci flake8: flake8 isort: make isort-check From 39bc917ba580f3d58fb882cb96546d731cd670f2 Mon Sep 17 00:00:00 2001 From: ontowhee <82607723+ontowhee@users.noreply.github.com> Date: Wed, 18 Dec 2024 22:15:13 -0800 Subject: [PATCH 3/3] try collectstatic in workflow --- .github/workflows/tests.yml | 72 ++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index df28ddc19..4384225ca 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -36,42 +36,42 @@ jobs: uses: actions/setup-python@v5 with: python-version: "${{ matrix.python-version }}" - - 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: 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 -r requirements/prod.txt - python -m manage collectstatic --djangoproject.settings.prod + python -m manage collectstatic --settings=djangoproject.settings.prod