From 2368f237421d541dfa15f2eb3cf56682b33745a3 Mon Sep 17 00:00:00 2001 From: James Addison Date: Sun, 10 Jan 2021 11:15:07 +0000 Subject: [PATCH 01/18] Add GitHub Actions package build workflow that invokes 'tox' --- .github/workflows/python-tox.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/workflows/python-tox.yml diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml new file mode 100644 index 00000000..18fbef36 --- /dev/null +++ b/.github/workflows/python-tox.yml @@ -0,0 +1,9 @@ +on: [pull_request, push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - run: pip install tox + - run: tox From 19ade46b6e22d263ab6d0876cfbc81c3744ad51b Mon Sep 17 00:00:00 2001 From: James Addison Date: Sun, 10 Jan 2021 11:34:21 +0000 Subject: [PATCH 02/18] Checkout git submodules during build workflow --- .github/workflows/python-tox.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index 18fbef36..11ce5126 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -4,6 +4,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + with: + submodules: true - uses: actions/setup-python@v2 - run: pip install tox - run: tox From e09d0ca97f198987d77f1e85cd1ecfb3bf62d7d1 Mon Sep 17 00:00:00 2001 From: James Addison Date: Sun, 10 Jan 2021 16:46:01 +0000 Subject: [PATCH 03/18] Add setup of all supported Python interpreters to GitHub Actions workflow --- .github/workflows/python-tox.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index 11ce5126..725cefb4 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -7,5 +7,25 @@ jobs: with: submodules: true - uses: actions/setup-python@v2 + with: + python-version: 2.7 + - uses: actions/setup-python@v2 + with: + python-version: 3.5 + - uses: actions/setup-python@v2 + with: + python-version: 3.6 + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + - uses: actions/setup-python@v2 + with: + python-version: pypy + - uses: actions/setup-python@v2 + with: + python-version: pypy3 - run: pip install tox - run: tox From c77658db72de468fa34098e1f0bc6bd29abc3207 Mon Sep 17 00:00:00 2001 From: James Addison Date: Sun, 10 Jan 2021 16:46:42 +0000 Subject: [PATCH 04/18] Enable parallel tox builds, with spinner disabled --- .github/workflows/python-tox.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index 725cefb4..96841f2e 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -28,4 +28,6 @@ jobs: with: python-version: pypy3 - run: pip install tox - - run: tox + - run: tox --parallel + env: + TOX_PARALLEL_NO_SPINNER: 1 From e9cc226b77c7765fefee0a1f81b86664f15a31ba Mon Sep 17 00:00:00 2001 From: James Addison Date: Sun, 10 Jan 2021 16:55:29 +0000 Subject: [PATCH 05/18] Include Python2.7 + PyPy build environment --- .github/workflows/python-tox.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index 96841f2e..eb644122 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -23,7 +23,7 @@ jobs: python-version: 3.8 - uses: actions/setup-python@v2 with: - python-version: pypy + python-version: pypy-2.7 - uses: actions/setup-python@v2 with: python-version: pypy3 From 12fed91c6fd24d996512748d35d908e0335e064d Mon Sep 17 00:00:00 2001 From: James Addison Date: Sun, 10 Jan 2021 17:20:49 +0000 Subject: [PATCH 06/18] Enable stdout output from tox in parallel mode With credit to @graingert via https://github.com/twisted/ldaptor/pull/207 --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 16b8cf41..80a5526b 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ envlist = py{27,35,36,37,38,py,py3}-{base,six19,optional} [testenv] +parallel_show_output = True deps = optional: -r{toxinidir}/requirements-optional.txt -r{toxinidir}/requirements-test.txt From c2171332634532d4ffd29e5edfe09bf6076fb279 Mon Sep 17 00:00:00 2001 From: James Addison Date: Sun, 10 Jan 2021 17:46:28 +0000 Subject: [PATCH 07/18] Prevent repository-internal pull requests from running duplicate tox builds via GitHub Actions; the 'push' event will have already run a build for commits related to them --- .github/workflows/python-tox.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index eb644122..f7ca97a6 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -1,6 +1,9 @@ on: [pull_request, push] jobs: build: + # Prevent duplicate builds for 'internal' pull requests on existing commits + # Credit: https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012 + if: github.event.push || github.event.pull_request.head.repo.full_name != github.repository runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 From 8dee9f0eb7adfec490881cec5577e276c38f8e55 Mon Sep 17 00:00:00 2001 From: James Addison Date: Tue, 12 Jan 2021 23:03:38 +0000 Subject: [PATCH 08/18] Experiment: move Python environment list from tox into GitHub Actions matrix strategy --- .github/workflows/python-tox.yml | 23 ++++------------------- tox.ini | 2 +- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index f7ca97a6..d84f7857 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -5,31 +5,16 @@ jobs: # Credit: https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012 if: github.event.push || github.event.pull_request.head.repo.full_name != github.repository runs-on: ubuntu-latest + strategy: + matrix: + python: [2.7, 3.5, 3.6, 3.7, 3.8, pypy-2.7, pypy3 steps: - uses: actions/checkout@v2 with: submodules: true - uses: actions/setup-python@v2 with: - python-version: 2.7 - - uses: actions/setup-python@v2 - with: - python-version: 3.5 - - uses: actions/setup-python@v2 - with: - python-version: 3.6 - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - uses: actions/setup-python@v2 - with: - python-version: pypy-2.7 - - uses: actions/setup-python@v2 - with: - python-version: pypy3 + python-version: ${{ matrix.python }} - run: pip install tox - run: tox --parallel env: diff --git a/tox.ini b/tox.ini index 80a5526b..9ff72158 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,35,36,37,38,py,py3}-{base,six19,optional} +envlist = py-{base,six19,optional} [testenv] parallel_show_output = True From 57a9c1af71bf79899eabc35fc38b2d5b1422b71d Mon Sep 17 00:00:00 2001 From: James Addison Date: Tue, 12 Jan 2021 23:04:36 +0000 Subject: [PATCH 09/18] Disable tox parallel run mode --- .github/workflows/python-tox.yml | 4 +--- tox.ini | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index d84f7857..98adea30 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -16,6 +16,4 @@ jobs: with: python-version: ${{ matrix.python }} - run: pip install tox - - run: tox --parallel - env: - TOX_PARALLEL_NO_SPINNER: 1 + - run: tox diff --git a/tox.ini b/tox.ini index 9ff72158..518868cd 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,6 @@ envlist = py-{base,six19,optional} [testenv] -parallel_show_output = True deps = optional: -r{toxinidir}/requirements-optional.txt -r{toxinidir}/requirements-test.txt From 4ef39c4b9d611ecda77e94bb546136bfc836a761 Mon Sep 17 00:00:00 2001 From: James Addison Date: Tue, 12 Jan 2021 23:07:57 +0000 Subject: [PATCH 10/18] Fixup: trailing list bracket --- .github/workflows/python-tox.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index 98adea30..adb6d261 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: [2.7, 3.5, 3.6, 3.7, 3.8, pypy-2.7, pypy3 + python: [2.7, 3.5, 3.6, 3.7, 3.8, pypy-2.7, pypy3] steps: - uses: actions/checkout@v2 with: From 808f7c649e515cae142592c98f8264e8120d65c5 Mon Sep 17 00:00:00 2001 From: James Addison Date: Tue, 12 Jan 2021 23:20:50 +0000 Subject: [PATCH 11/18] Revert "Fixup: trailing list bracket" This reverts commit 4ef39c4b9d611ecda77e94bb546136bfc836a761. --- .github/workflows/python-tox.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index adb6d261..98adea30 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: [2.7, 3.5, 3.6, 3.7, 3.8, pypy-2.7, pypy3] + python: [2.7, 3.5, 3.6, 3.7, 3.8, pypy-2.7, pypy3 steps: - uses: actions/checkout@v2 with: From 8040d958a98e2f3d1ab9baae8e30b2f85f478fe3 Mon Sep 17 00:00:00 2001 From: James Addison Date: Tue, 12 Jan 2021 23:20:56 +0000 Subject: [PATCH 12/18] Revert "Disable tox parallel run mode" This reverts commit 57a9c1af71bf79899eabc35fc38b2d5b1422b71d. --- .github/workflows/python-tox.yml | 4 +++- tox.ini | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index 98adea30..d84f7857 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -16,4 +16,6 @@ jobs: with: python-version: ${{ matrix.python }} - run: pip install tox - - run: tox + - run: tox --parallel + env: + TOX_PARALLEL_NO_SPINNER: 1 diff --git a/tox.ini b/tox.ini index 518868cd..9ff72158 100644 --- a/tox.ini +++ b/tox.ini @@ -2,6 +2,7 @@ envlist = py-{base,six19,optional} [testenv] +parallel_show_output = True deps = optional: -r{toxinidir}/requirements-optional.txt -r{toxinidir}/requirements-test.txt From 86f80bc4ec1d564f3289e7f243f7bd2c64862fdd Mon Sep 17 00:00:00 2001 From: James Addison Date: Tue, 12 Jan 2021 23:21:05 +0000 Subject: [PATCH 13/18] Revert "Experiment: move Python environment list from tox into GitHub Actions matrix strategy" This reverts commit 8dee9f0eb7adfec490881cec5577e276c38f8e55. --- .github/workflows/python-tox.yml | 23 +++++++++++++++++++---- tox.ini | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index d84f7857..f7ca97a6 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -5,16 +5,31 @@ jobs: # Credit: https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012 if: github.event.push || github.event.pull_request.head.repo.full_name != github.repository runs-on: ubuntu-latest - strategy: - matrix: - python: [2.7, 3.5, 3.6, 3.7, 3.8, pypy-2.7, pypy3 steps: - uses: actions/checkout@v2 with: submodules: true - uses: actions/setup-python@v2 with: - python-version: ${{ matrix.python }} + python-version: 2.7 + - uses: actions/setup-python@v2 + with: + python-version: 3.5 + - uses: actions/setup-python@v2 + with: + python-version: 3.6 + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + - uses: actions/setup-python@v2 + with: + python-version: 3.8 + - uses: actions/setup-python@v2 + with: + python-version: pypy-2.7 + - uses: actions/setup-python@v2 + with: + python-version: pypy3 - run: pip install tox - run: tox --parallel env: diff --git a/tox.ini b/tox.ini index 9ff72158..80a5526b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py-{base,six19,optional} +envlist = py{27,35,36,37,38,py,py3}-{base,six19,optional} [testenv] parallel_show_output = True From e6ccea78e0f3b227ac301d2cd3386e56ab37fc6d Mon Sep 17 00:00:00 2001 From: James Addison Date: Tue, 12 Jan 2021 23:22:15 +0000 Subject: [PATCH 14/18] Duplicate Python environment list from tox in GitHub Actions matrix strategy --- .github/workflows/python-tox.yml | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index f7ca97a6..d84f7857 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -5,31 +5,16 @@ jobs: # Credit: https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012 if: github.event.push || github.event.pull_request.head.repo.full_name != github.repository runs-on: ubuntu-latest + strategy: + matrix: + python: [2.7, 3.5, 3.6, 3.7, 3.8, pypy-2.7, pypy3 steps: - uses: actions/checkout@v2 with: submodules: true - uses: actions/setup-python@v2 with: - python-version: 2.7 - - uses: actions/setup-python@v2 - with: - python-version: 3.5 - - uses: actions/setup-python@v2 - with: - python-version: 3.6 - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - uses: actions/setup-python@v2 - with: - python-version: 3.8 - - uses: actions/setup-python@v2 - with: - python-version: pypy-2.7 - - uses: actions/setup-python@v2 - with: - python-version: pypy3 + python-version: ${{ matrix.python }} - run: pip install tox - run: tox --parallel env: From f18776cee2cf70a0728be85dd56f5b563634b6a9 Mon Sep 17 00:00:00 2001 From: James Addison Date: Tue, 12 Jan 2021 23:04:36 +0000 Subject: [PATCH 15/18] Disable tox parallel run mode --- .github/workflows/python-tox.yml | 4 +--- tox.ini | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index d84f7857..98adea30 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -16,6 +16,4 @@ jobs: with: python-version: ${{ matrix.python }} - run: pip install tox - - run: tox --parallel - env: - TOX_PARALLEL_NO_SPINNER: 1 + - run: tox diff --git a/tox.ini b/tox.ini index 80a5526b..16b8cf41 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,6 @@ envlist = py{27,35,36,37,38,py,py3}-{base,six19,optional} [testenv] -parallel_show_output = True deps = optional: -r{toxinidir}/requirements-optional.txt -r{toxinidir}/requirements-test.txt From 90139eb3507f4f04d96796d478e5d574ea97e4a1 Mon Sep 17 00:00:00 2001 From: James Addison Date: Tue, 12 Jan 2021 23:23:55 +0000 Subject: [PATCH 16/18] Request a single Python environment (the current default Python interpreter) for each GHA worker --- .github/workflows/python-tox.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index 98adea30..c30b3de9 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -16,4 +16,4 @@ jobs: with: python-version: ${{ matrix.python }} - run: pip install tox - - run: tox + - run: tox -e py From 19cf7f750a74c95dad92c64b811fa859dcc4313b Mon Sep 17 00:00:00 2001 From: James Addison Date: Tue, 12 Jan 2021 23:07:57 +0000 Subject: [PATCH 17/18] Fixup: trailing list bracket --- .github/workflows/python-tox.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index c30b3de9..78589e48 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python: [2.7, 3.5, 3.6, 3.7, 3.8, pypy-2.7, pypy3 + python: [2.7, 3.5, 3.6, 3.7, 3.8, pypy-2.7, pypy3] steps: - uses: actions/checkout@v2 with: From 92b4b90962cfa263742c5946f46f26ed0d76cb84 Mon Sep 17 00:00:00 2001 From: James Addison Date: Tue, 19 Jan 2021 21:12:13 +0000 Subject: [PATCH 18/18] Always print html5lib debug info at the end of GitHub Actions build Uses a job status check conditional; see https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#job-status-check-functions --- .github/workflows/python-tox.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/python-tox.yml b/.github/workflows/python-tox.yml index 78589e48..ec5cf636 100644 --- a/.github/workflows/python-tox.yml +++ b/.github/workflows/python-tox.yml @@ -17,3 +17,5 @@ jobs: python-version: ${{ matrix.python }} - run: pip install tox - run: tox -e py + - if: ${{ always() }} + run: python debug-info.py