From 6b0400dbcd51499a7d0b3a7294a1d3c4d1d35fa2 Mon Sep 17 00:00:00 2001 From: Martin Whitehouse Date: Fri, 5 Aug 2022 10:04:50 +0200 Subject: [PATCH 1/5] Add cache to workflow --- .github/workflows/pythonpackage.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 70b2482d..db0adfd6 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -12,27 +12,38 @@ jobs: python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} + + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-testing.txt')}}-${{ hashFiles('tox.ini') }} + - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt -r requirements-testing.txt -c constraints-Django32.txt + - name: Format style check with 'autopep8' run: | pip install autopep8 autopep8 --exit-code --global-config .flake8 helpdesk - - name: Lint with flake8 + + - name: Lint with 'flake8' run: | pip install flake8 # stop the build if there are Python syntax errors or undefined names # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide flake8 helpdesk --count --show-source --statistics --exit-zero --max-complexity=20 + - name: Sort style check with 'isort' run: | isort --line-length=120 --src helpdesk . --check + - name: Test with pytest run: | pip install pytest From cb35578b70a078897e32cb11c81d51aa9c1f74c8 Mon Sep 17 00:00:00 2001 From: Martin Whitehouse Date: Fri, 5 Aug 2022 10:09:00 +0200 Subject: [PATCH 2/5] Add python version to cache key Prevents conflicts --- .github/workflows/pythonpackage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index db0adfd6..f46e197f 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/cache@v2 with: path: ~/.cache/pip - key: ${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-testing.txt')}}-${{ hashFiles('tox.ini') }} + key: ${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-testing.txt')}}-${{ hashFiles('tox.ini') }}-${{ matrix.python-version }} - name: Install dependencies run: | From a51933f9bff6533de4cb5ba9896a05f6283c7f4d Mon Sep 17 00:00:00 2001 From: Martin Whitehouse Date: Fri, 5 Aug 2022 10:28:31 +0200 Subject: [PATCH 3/5] Bump django 2.2 -> 3.2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7cc1c79c..f49a88f4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Django>=2.2 +Django>=3.2 django-bootstrap4-form celery email-reply-parser From cd480b2750e7bf94f5e26d66e35bc87be508a832 Mon Sep 17 00:00:00 2001 From: Martin Whitehouse Date: Fri, 5 Aug 2022 14:27:29 +0200 Subject: [PATCH 4/5] Add Djagno versions to test matrix 32 and 4 used for constraints --- .github/workflows/pythonpackage.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index f46e197f..751a03a4 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -10,6 +10,7 @@ jobs: max-parallel: 4 matrix: python-version: ["3.8", "3.9", "3.10"] + django-version: ["32","4"] steps: - uses: actions/checkout@v3 @@ -21,12 +22,12 @@ jobs: - uses: actions/cache@v2 with: path: ~/.cache/pip - key: ${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-testing.txt')}}-${{ hashFiles('tox.ini') }}-${{ matrix.python-version }} + key: ${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-testing.txt')}}-${{ hashFiles('tox.ini') }}-${{ matrix.python-version }}-${{ matrix.django-version }} - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -r requirements.txt -r requirements-testing.txt -c constraints-Django32.txt + pip install -r requirements.txt -r requirements-testing.txt -c constraints-Django${{ matrix.django-version }}.txt - name: Format style check with 'autopep8' run: | From 8ab7599bea0fc7af825a1e0f2cb80b9513e299ef Mon Sep 17 00:00:00 2001 From: Martin Whitehouse Date: Fri, 5 Aug 2022 14:43:53 +0200 Subject: [PATCH 5/5] Remove parallel constraint --- .github/workflows/pythonpackage.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 751a03a4..dfd82e51 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -7,7 +7,6 @@ jobs: runs-on: ubuntu-latest strategy: - max-parallel: 4 matrix: python-version: ["3.8", "3.9", "3.10"] django-version: ["32","4"]