From 05df5e104d01270253b50e0c7b5e7ad7c61c87ee Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Fri, 13 Sep 2024 08:03:18 -0400 Subject: [PATCH 1/4] add a github action check to ensure collectstatic runs --- .github/workflows/static.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/static.yml diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 000000000..4761c61dd --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,29 @@ +name: Check collectstatic +on: [push, pull_request] +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: 3.12.6 + - name: Cache Python dependencies + uses: actions/cache@v4 + env: + cache-name: pythondotorg-cache-pip + with: + path: ~/.cache/pip + key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt', '*-requirements.txt') }} + restore-keys: | + ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}- + ${{ runner.os }}-${{ github.job }}- + ${{ runner.os }}- + - name: Install Python dependencies + run: | + pip install -U pip setuptools wheel + pip install -r dev-requirements.txt + - name: Run Tests + run: | + DJANGO_SETTINGS_MODULE=pydotorg.settings.static python manage.py collectstatic --noinput From b444a30be936b0dadf887fb7cd56786e9db0301d Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Fri, 13 Sep 2024 08:05:36 -0400 Subject: [PATCH 2/4] install prod reqs --- .github/workflows/static.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 4761c61dd..3d9f61e6b 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -23,7 +23,7 @@ jobs: - name: Install Python dependencies run: | pip install -U pip setuptools wheel - pip install -r dev-requirements.txt + pip install -r requirements.txt -r prod-requirements.txt - name: Run Tests run: | DJANGO_SETTINGS_MODULE=pydotorg.settings.static python manage.py collectstatic --noinput From 42bda2e35905509e01a55afb22c7aaac935ed56f Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Fri, 13 Sep 2024 09:32:29 -0400 Subject: [PATCH 3/4] fallback to .python-version --- .github/workflows/ci.yml | 2 -- .github/workflows/static.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42f8472ea..73b89758a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,8 +30,6 @@ jobs: wget https://github.com/jgm/pandoc/releases/download/2.17.1.1/pandoc-2.17.1.1-1-amd64.deb sudo dpkg -i pandoc-2.17.1.1-1-amd64.deb - uses: actions/setup-python@v5 - with: - python-version: 3.12.6 - name: Cache Python dependencies uses: actions/cache@v4 env: diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 3d9f61e6b..c20628f55 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -7,8 +7,6 @@ jobs: - name: Check out repository uses: actions/checkout@v4 - uses: actions/setup-python@v5 - with: - python-version: 3.12.6 - name: Cache Python dependencies uses: actions/cache@v4 env: From f48666eafd252abb00667f7c2a0b0b1c56fc5a7e Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Fri, 13 Sep 2024 09:34:46 -0400 Subject: [PATCH 4/4] explicitly set python-version-file --- .github/workflows/ci.yml | 2 ++ .github/workflows/static.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73b89758a..ed08f4b7f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,8 @@ jobs: wget https://github.com/jgm/pandoc/releases/download/2.17.1.1/pandoc-2.17.1.1-1-amd64.deb sudo dpkg -i pandoc-2.17.1.1-1-amd64.deb - uses: actions/setup-python@v5 + with: + python-version-file: '.python-version' - name: Cache Python dependencies uses: actions/cache@v4 env: diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index c20628f55..3207b964e 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -7,6 +7,8 @@ jobs: - name: Check out repository uses: actions/checkout@v4 - uses: actions/setup-python@v5 + with: + python-version-file: '.python-version' - name: Cache Python dependencies uses: actions/cache@v4 env: