From addfc03a525fe981efe0902e84a50fab37f3f70c Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 14:04:26 +0530 Subject: [PATCH 01/22] Travis: Merge all developer tooling jobs into 1 --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7259b473a45..e81bb482979 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,11 +13,9 @@ stages: jobs: include: - # Basic Checks + # Developer Tooling - stage: primary - env: TOXENV=docs - - env: TOXENV=lint - - env: TOXENV=vendoring + env: TOXENV=lint,docs,vendoring # Latest CPython - env: GROUP=1 python: 2.7 From c06b144036d0f360ef63c9429b1c86701f258084 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 13:12:03 +0530 Subject: [PATCH 02/22] docs: Reword part of pip's CI docs --- docs/html/development/ci.rst | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/docs/html/development/ci.rst b/docs/html/development/ci.rst index dbd80eb6cef..1564e541013 100644 --- a/docs/html/development/ci.rst +++ b/docs/html/development/ci.rst @@ -34,28 +34,30 @@ and on different architectures: - x64 - x86 -so 42 hypothetical interpreters. +so 42 hypothetical combinations. Checks ====== -``pip`` CI runs different kind of tests: +``pip`` CI runs various "checks": -- lint (defined in ``.pre-commit-config.yaml``) -- docs -- vendoring (is the ``src/_internal/_vendor`` directory cleanly vendored) -- unit tests (present in ``tests/unit``) -- "integration" tests (mostly present in ``tests/functional``) -- package (test the packaging steps) +- Development tooling + - docs (does the documentation build correctly?) + - lint (automated code quality checks, run with ``pre-commit``) + - vendoring (is ``src/pip/_vendor`` correctly constructed?) +- Tests + - unit tests (present in ``tests/unit``) + - "integration" tests (mostly present in ``tests/functional``) +- Packaging (test the packaging steps) -Since lint, docs, vendoring and package tests only need to run on a pip -developer/contributor machine, they only need to be tested on the x64 variant -of the 3 different operating systems, and when an interpreter needs to be -specified it's ok to require the latest CPython interpreter. +We run development tooling checks on the latest CPython (x64), on every +OS. This helps ensure they'll also run on a pip developer/contributor's +machine regardless of the OS they use. -So only unit tests and integration tests would need to be run with the different -interpreters. +We try to run the tests on as many interpreter-OS-architecture +combinations as we can, without having a significant slowdown on our +productivity due to CI wait times. Services @@ -91,7 +93,7 @@ Actual testing -------------- +------------------------------+---------------+-----------------+ -| **interpreter** | **unit** | **integration** | +| **combination** | **unit** | **integration** | +-----------+----------+-------+---------------+-----------------+ | | | CP2.7 | Azure | Azure | | | +-------+---------------+-----------------+ From 1c59a8b75533ef27393abbfb9f7dd11d0ec60176 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 14:09:40 +0530 Subject: [PATCH 03/22] docs: Add TODOs to our CI documentation --- docs/html/development/ci.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/html/development/ci.rst b/docs/html/development/ci.rst index 1564e541013..b7e70b971fe 100644 --- a/docs/html/development/ci.rst +++ b/docs/html/development/ci.rst @@ -74,6 +74,13 @@ provides free executors for open source packages: .. _`Azure DevOps CI`: https://azure.microsoft.com/en-us/services/devops/ .. _`GitHub Actions`: https://github.com/features/actions +TODO + +- how many workers we get per-CI-service. +- add links to "most relevant resources" for each CI-service. +- describe how our runs are set up for short-circuiting on failures in + linting / documentation / vendoring / unit tests / integration tests. + Current run tests ================= From ab810ae047df445d55be81986f63c72acb8642e3 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 13:49:08 +0530 Subject: [PATCH 04/22] Azure: Add PyPy interpreters --- .azure-pipelines/jobs/test-windows.yml | 8 ++++++++ docs/html/development/ci.rst | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/jobs/test-windows.yml b/.azure-pipelines/jobs/test-windows.yml index 1a933a6934b..207f20d3af8 100644 --- a/.azure-pipelines/jobs/test-windows.yml +++ b/.azure-pipelines/jobs/test-windows.yml @@ -29,6 +29,14 @@ jobs: Python38-x64: python.version: '3.8' python.architecture: x64 + PyPy2: + python.version: '2.7' + python.architecture: x64 + python.flavor: pypy + PyPy3: + python.version: '3.5' + python.architecture: x64 + python.flavor: pypy maxParallel: 6 steps: diff --git a/docs/html/development/ci.rst b/docs/html/development/ci.rst index b7e70b971fe..63c739984b9 100644 --- a/docs/html/development/ci.rst +++ b/docs/html/development/ci.rst @@ -126,9 +126,9 @@ Actual testing | | +-------+---------------+-----------------+ | | | CP3.8 | Azure | Azure | | | +-------+---------------+-----------------+ -| | | PyPy | | | +| | | PyPy | Azure | Azure | | | +-------+---------------+-----------------+ -| | | PyPy3 | | | +| | | PyPy3 | Azure | Azure | +-----------+----------+-------+---------------+-----------------+ | | | CP2.7 | | | | | +-------+---------------+-----------------+ From a13e44780db888bdb760b1bade11e19eb3f64283 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 13:51:53 +0530 Subject: [PATCH 05/22] Azure: Add developer tooling check --- .azure-pipelines/jobs/dev-tools.yml | 16 ++++++++++++++++ .azure-pipelines/windows.yml | 5 +++++ docs/html/development/ci.rst | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .azure-pipelines/jobs/dev-tools.yml diff --git a/.azure-pipelines/jobs/dev-tools.yml b/.azure-pipelines/jobs/dev-tools.yml new file mode 100644 index 00000000000..05a165ba579 --- /dev/null +++ b/.azure-pipelines/jobs/dev-tools.yml @@ -0,0 +1,16 @@ +parameters: + vmImage: + +jobs: +- job: Developer Tooling + steps: + - task: UsePythonVersion@0 + displayName: Use Python 3 latest + inputs: + versionSpec: '3' + + - bash: pip install tox + displayName: Install dependencies + + - bash: tox -e lint,docs,vendoring + displayName: Run the development tools diff --git a/.azure-pipelines/windows.yml b/.azure-pipelines/windows.yml index 9d1bf5385d0..ced172e5583 100644 --- a/.azure-pipelines/windows.yml +++ b/.azure-pipelines/windows.yml @@ -1,4 +1,9 @@ jobs: + +- template: jobs/dev-tools.yml + parameters: + vmImage: vs2017-win2016 + - template: jobs/test-windows.yml parameters: vmImage: vs2017-win2016 diff --git a/docs/html/development/ci.rst b/docs/html/development/ci.rst index 63c739984b9..70fcdeb7f06 100644 --- a/docs/html/development/ci.rst +++ b/docs/html/development/ci.rst @@ -92,7 +92,7 @@ Developer tasks OS docs lint vendoring packages ======== =============== ================ ================== ============ Linux Travis, Github Travis, Github Travis, Github Azure -Windows Azure +Windows Azure Azure Azure Azure MacOS Azure ======== =============== ================ ================== ============ From 54a30ddbffcd3223f6c39770f8b5fdec99b7ac94 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 13:52:36 +0530 Subject: [PATCH 06/22] Azure: Drop Linux and MacOS checks --- .azure-pipelines/jobs/test.yml | 41 ---------------------------- .azure-pipelines/linux.yml | 8 ------ .azure-pipelines/macos.yml | 8 ------ .azure-pipelines/steps/run-tests.yml | 25 ----------------- docs/html/development/ci.rst | 22 +++++++-------- 5 files changed, 11 insertions(+), 93 deletions(-) delete mode 100644 .azure-pipelines/jobs/test.yml delete mode 100644 .azure-pipelines/linux.yml delete mode 100644 .azure-pipelines/macos.yml delete mode 100644 .azure-pipelines/steps/run-tests.yml diff --git a/.azure-pipelines/jobs/test.yml b/.azure-pipelines/jobs/test.yml deleted file mode 100644 index cadf99a51f7..00000000000 --- a/.azure-pipelines/jobs/test.yml +++ /dev/null @@ -1,41 +0,0 @@ -parameters: - vmImage: - -jobs: -- job: Test_Primary - displayName: Test Primary - - pool: - vmImage: ${{ parameters.vmImage }} - strategy: - matrix: - Python27: - python.version: '2.7' - python.architecture: x64 - Python36: - python.version: '3.6' - python.architecture: x64 - maxParallel: 2 - - steps: - - template: ../steps/run-tests.yml - -- job: Test_Secondary - displayName: Test Secondary - # Run after Test_Primary so we don't devour time and jobs if tests are going to fail - dependsOn: Test_Primary - - pool: - vmImage: ${{ parameters.vmImage }} - strategy: - matrix: - Python35: - python.version: '3.5' - python.architecture: x64 - Python37: - python.version: '3.7' - python.architecture: x64 - maxParallel: 3 - - steps: - - template: ../steps/run-tests.yml diff --git a/.azure-pipelines/linux.yml b/.azure-pipelines/linux.yml deleted file mode 100644 index 6965a15fc6d..00000000000 --- a/.azure-pipelines/linux.yml +++ /dev/null @@ -1,8 +0,0 @@ -jobs: -- template: jobs/test.yml - parameters: - vmImage: ubuntu-16.04 - -- template: jobs/package.yml - parameters: - vmImage: ubuntu-16.04 diff --git a/.azure-pipelines/macos.yml b/.azure-pipelines/macos.yml deleted file mode 100644 index 85c2a0246af..00000000000 --- a/.azure-pipelines/macos.yml +++ /dev/null @@ -1,8 +0,0 @@ -jobs: -- template: jobs/test.yml - parameters: - vmImage: macos-10.14 - -- template: jobs/package.yml - parameters: - vmImage: macos-10.14 diff --git a/.azure-pipelines/steps/run-tests.yml b/.azure-pipelines/steps/run-tests.yml deleted file mode 100644 index 64163a5be8b..00000000000 --- a/.azure-pipelines/steps/run-tests.yml +++ /dev/null @@ -1,25 +0,0 @@ -steps: -- task: UsePythonVersion@0 - displayName: Use Python $(python.version) - inputs: - versionSpec: '$(python.version)' - -- bash: pip install --upgrade setuptools tox - displayName: Install Tox - -- script: tox -e py -- -m unit -n auto --junit-xml=junit/unit-test.xml - displayName: Tox run unit tests - -# Run integration tests in two groups so we will fail faster if there is a failure in the first group -- script: tox -e py -- -m integration -n auto --duration=5 -k "not test_install" --junit-xml=junit/integration-test-group0.xml - displayName: Tox run Group 0 integration tests - -- script: tox -e py -- -m integration -n auto --duration=5 -k "test_install" --junit-xml=junit/integration-test-group1.xml - displayName: Tox run Group 1 integration tests - -- task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFiles: junit/*.xml - testRunTitle: 'Python $(python.version)' - condition: succeededOrFailed() diff --git a/docs/html/development/ci.rst b/docs/html/development/ci.rst index 70fcdeb7f06..e9aa39ff59f 100644 --- a/docs/html/development/ci.rst +++ b/docs/html/development/ci.rst @@ -67,7 +67,7 @@ pip test suite and checks are distributed on three different platforms that provides free executors for open source packages: - `Travis CI`_ (Used for Linux) - - `Azure DevOps CI`_ (Linux, MacOS & Windows tests) + - `Azure DevOps CI`_ (Used for Windows) - `GitHub Actions`_ (Linux, MacOS & Windows tests) .. _`Travis CI`: https://travis-ci.org/ @@ -91,9 +91,9 @@ Developer tasks ======== =============== ================ ================== ============ OS docs lint vendoring packages ======== =============== ================ ================== ============ -Linux Travis, Github Travis, Github Travis, Github Azure +Linux Travis, Github Travis, Github Travis, Github Windows Azure Azure Azure Azure -MacOS Azure +MacOS ======== =============== ================ ================== ============ Actual testing @@ -144,13 +144,13 @@ Actual testing | | +-------+---------------+-----------------+ | | | PyPy3 | | | | Linux +----------+-------+---------------+-----------------+ -| | | CP2.7 | Travis,Azure | Travis,Azure | +| | | CP2.7 | Travis | Travis | | | +-------+---------------+-----------------+ -| | | CP3.5 | Travis,Azure | Travis,Azure | +| | | CP3.5 | Travis | Travis | | | +-------+---------------+-----------------+ -| | | CP3.6 | Travis,Azure | Travis,Azure | +| | | CP3.6 | Travis | Travis | | | +-------+---------------+-----------------+ -| | x64 | CP3.7 | Travis,Azure | Travis,Azure | +| | x64 | CP3.7 | Travis | Travis | | | +-------+---------------+-----------------+ | | | CP3.8 | Travis | Travis | | | +-------+---------------+-----------------+ @@ -172,13 +172,13 @@ Actual testing | | +-------+---------------+-----------------+ | | | PyPy3 | | | | MacOS +----------+-------+---------------+-----------------+ -| | | CP2.7 | Azure | Azure | +| | | CP2.7 | | | | | +-------+---------------+-----------------+ -| | | CP3.5 | Azure | Azure | +| | | CP3.5 | | | | | +-------+---------------+-----------------+ -| | | CP3.6 | Azure | Azure | +| | | CP3.6 | | | | | +-------+---------------+-----------------+ -| | x64 | CP3.7 | Azure | Azure | +| | x64 | CP3.7 | | | | | +-------+---------------+-----------------+ | | | CP3.8 | | | | | +-------+---------------+-----------------+ From ea82b339443497c6928fd6f565795ba0d22d092a Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 13:54:34 +0530 Subject: [PATCH 07/22] Azure: Demote Python 2.7-x86 to only unit tests --- .azure-pipelines/jobs/test-windows.yml | 6 +++--- docs/html/development/ci.rst | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/jobs/test-windows.yml b/.azure-pipelines/jobs/test-windows.yml index 207f20d3af8..e99c9d31ec8 100644 --- a/.azure-pipelines/jobs/test-windows.yml +++ b/.azure-pipelines/jobs/test-windows.yml @@ -9,9 +9,6 @@ jobs: vmImage: ${{ parameters.vmImage }} strategy: matrix: - Python27-x86: - python.version: '2.7' - python.architecture: x86 Python27-x64: python.version: '2.7' python.architecture: x64 @@ -56,6 +53,9 @@ jobs: strategy: matrix: # This is for Windows, so test x86 builds + Python27-x86: + python.version: '2.7' + python.architecture: x86 Python35-x86: python.version: '3.5' python.architecture: x86 diff --git a/docs/html/development/ci.rst b/docs/html/development/ci.rst index e9aa39ff59f..006542dd1b9 100644 --- a/docs/html/development/ci.rst +++ b/docs/html/development/ci.rst @@ -102,7 +102,7 @@ Actual testing +------------------------------+---------------+-----------------+ | **combination** | **unit** | **integration** | +-----------+----------+-------+---------------+-----------------+ -| | | CP2.7 | Azure | Azure | +| | | CP2.7 | Azure | | | | +-------+---------------+-----------------+ | | | CP3.5 | Azure | | | | +-------+---------------+-----------------+ From 2e1e3a49c51eed33331ed531494eee53eec7ac7d Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 13:57:06 +0530 Subject: [PATCH 08/22] Azure: Don't run tests unless linters pass --- .azure-pipelines/jobs/dev-tools.yml | 2 +- .azure-pipelines/jobs/test-windows.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/jobs/dev-tools.yml b/.azure-pipelines/jobs/dev-tools.yml index 05a165ba579..549d2ed46c5 100644 --- a/.azure-pipelines/jobs/dev-tools.yml +++ b/.azure-pipelines/jobs/dev-tools.yml @@ -2,7 +2,7 @@ parameters: vmImage: jobs: -- job: Developer Tooling +- job: Developer_Tooling steps: - task: UsePythonVersion@0 displayName: Use Python 3 latest diff --git a/.azure-pipelines/jobs/test-windows.yml b/.azure-pipelines/jobs/test-windows.yml index e99c9d31ec8..a007a969eb8 100644 --- a/.azure-pipelines/jobs/test-windows.yml +++ b/.azure-pipelines/jobs/test-windows.yml @@ -3,6 +3,7 @@ parameters: jobs: - job: Test_Primary + dependsOn: Developer_Tooling displayName: Test Primary pool: From 8317c3f836707b08444c9d978fe02227201b4a3c Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 12:18:07 +0530 Subject: [PATCH 09/22] GitHub Actions: Simpler bot name --- .github/workflows/python-linters.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/python-linters.yml b/.github/workflows/python-linters.yml index 0b9bb0a2e44..015edb68974 100644 --- a/.github/workflows/python-linters.yml +++ b/.github/workflows/python-linters.yml @@ -1,6 +1,4 @@ -name: >- - 🤖 - Code quality +name: 🤖 on: push: From bdc4e2d9623cdb662f82f1108475024fbcf324eb Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 12:18:33 +0530 Subject: [PATCH 10/22] GitHub Actions: :fire: Drop a no-op comment --- .github/workflows/python-linters.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/python-linters.yml b/.github/workflows/python-linters.yml index 015edb68974..50ee6ee3a7b 100644 --- a/.github/workflows/python-linters.yml +++ b/.github/workflows/python-linters.yml @@ -14,10 +14,7 @@ jobs: ${{ matrix.env.TOXENV }}/${{ matrix.python-version }}@${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: - # max-parallel: 5 matrix: - python-version: - - 3.8 os: - ubuntu-latest - windows-latest From c36037c82c90ec69a7bb460000c1b290c76f55a7 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 12:19:30 +0530 Subject: [PATCH 11/22] GitHub Actions: Iterate on naming of check --- .github/workflows/python-linters.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-linters.yml b/.github/workflows/python-linters.yml index 50ee6ee3a7b..bb1a4ae4322 100644 --- a/.github/workflows/python-linters.yml +++ b/.github/workflows/python-linters.yml @@ -10,15 +10,15 @@ on: jobs: linters: - name: >- - ${{ matrix.env.TOXENV }}/${{ matrix.python-version }}@${{ matrix.os }} - runs-on: ${{ matrix.os }} + name: @${{ matrix.os }} ${{ matrix.env.TOXENV }} + runs-on: ${{ matrix.os }}-latest + strategy: matrix: os: - - ubuntu-latest - - windows-latest - - macos-latest + - ubuntu + - windows + - macos env: - TOXENV: docs - TOXENV: lint From 92e44f44aa01ff9c99c14759d430d35efa4003be Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 12:20:28 +0530 Subject: [PATCH 12/22] GitHub Actions: Hardcode Python version --- .github/workflows/python-linters.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-linters.yml b/.github/workflows/python-linters.yml index bb1a4ae4322..1811c5c8858 100644 --- a/.github/workflows/python-linters.yml +++ b/.github/workflows/python-linters.yml @@ -29,10 +29,11 @@ jobs: steps: - uses: actions/checkout@master - - name: Set up Python ${{ matrix.python-version }} + + - name: Set up Python 3.8 uses: actions/setup-python@v1 with: - python-version: ${{ matrix.python-version }} + python-version: 3.8 - name: Log Python version run: >- python --version From 88b2ea268f2baaba489b339b996478b451db9a00 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 12:22:41 +0530 Subject: [PATCH 13/22] GitHub Actions: Set up git configuration earlier --- .github/workflows/python-linters.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-linters.yml b/.github/workflows/python-linters.yml index 1811c5c8858..4f69189fc29 100644 --- a/.github/workflows/python-linters.yml +++ b/.github/workflows/python-linters.yml @@ -28,6 +28,8 @@ jobs: TOX_PARALLEL_NO_SPINNER: 1 steps: + + # Setup Python and git. - uses: actions/checkout@master - name: Set up Python 3.8 @@ -43,6 +45,10 @@ jobs: - name: Log Python env run: >- python -m sysconfig + - name: Pre-configure global Git settings + run: | + git config --global user.email "pypa-dev@googlegroups.com" + git config --global user.name "pip" - name: Pip cache uses: actions/cache@v1 with: @@ -57,10 +63,6 @@ jobs: with: path: ~/.cache/pre-commit key: pre-commit|2020-02-14|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} - - name: Pre-configure global Git settings - run: | - git config --global user.email "pypa-dev@googlegroups.com" - git config --global user.name "pip" - name: Update setuptools run: >- python -m pip install --upgrade setuptools From 76774ccc11e12c4e1459e800fdab682667a5b8c2 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 12:23:34 +0530 Subject: [PATCH 14/22] GitHub Actions: :fire: debugging info for Python --- .github/workflows/python-linters.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/python-linters.yml b/.github/workflows/python-linters.yml index 4f69189fc29..16a60084676 100644 --- a/.github/workflows/python-linters.yml +++ b/.github/workflows/python-linters.yml @@ -36,15 +36,6 @@ jobs: uses: actions/setup-python@v1 with: python-version: 3.8 - - name: Log Python version - run: >- - python --version - - name: Log Python location - run: >- - which python - - name: Log Python env - run: >- - python -m sysconfig - name: Pre-configure global Git settings run: | git config --global user.email "pypa-dev@googlegroups.com" From 3cea97786287c4601d971441bee2e20dd75a7533 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 12:24:28 +0530 Subject: [PATCH 15/22] GitHub Actions: :art: Setup CI caching steps --- .github/workflows/python-linters.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python-linters.yml b/.github/workflows/python-linters.yml index 16a60084676..4ecfc4f45a4 100644 --- a/.github/workflows/python-linters.yml +++ b/.github/workflows/python-linters.yml @@ -40,7 +40,12 @@ jobs: run: | git config --global user.email "pypa-dev@googlegroups.com" git config --global user.name "pip" - - name: Pip cache + + # Set up caching + - name: set PY + run: echo "::set-env name=PY::$(python -VV | sha256sum | cut -d' ' -f1)" + + - name: Storing pip's cache uses: actions/cache@v1 with: path: ~/.cache/pip @@ -48,12 +53,13 @@ jobs: restore-keys: | ${{ runner.os }}-pip- ${{ runner.os }}- - - name: set PY - run: echo "::set-env name=PY::$(python -VV | sha256sum | cut -d' ' -f1)" - - uses: actions/cache@v1 + + - name: Storing pre-commit's cache + uses: actions/cache@v1 with: path: ~/.cache/pre-commit key: pre-commit|2020-02-14|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + - name: Update setuptools run: >- python -m pip install --upgrade setuptools From 9a5854fbf8f348aa5a6f23ecf9e211e55fa62bc3 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 12:25:51 +0530 Subject: [PATCH 16/22] GitHub Actions: :art: Tooling installation --- .github/workflows/python-linters.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-linters.yml b/.github/workflows/python-linters.yml index 4ecfc4f45a4..2a7dfd6b88f 100644 --- a/.github/workflows/python-linters.yml +++ b/.github/workflows/python-linters.yml @@ -60,15 +60,14 @@ jobs: path: ~/.cache/pre-commit key: pre-commit|2020-02-14|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + # Update tooling - name: Update setuptools - run: >- - python -m pip install --upgrade setuptools + run: python -m pip install --upgrade setuptools - name: Install tox - run: >- - python -m pip install --upgrade tox tox-venv + run: python -m pip install --upgrade tox - name: Log the list of packages - run: >- - python -m pip freeze --all + run: python -m pip freeze --all + - name: 'Initialize tox envs: ${{ matrix.env.TOXENV }}' run: >- python -m From 2ef3d436388f96e98efcd4bdc05de3d54af97d92 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 12:30:40 +0530 Subject: [PATCH 17/22] GitHub Actions: :fire: Drop setup-envs-early steps There is not much benefit from having these as a separate step that could catch env-setup errors early IMO. They'd still be easily identifiable failures, without the complexity of those commands in our CI configuration. --- .github/workflows/python-linters.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/python-linters.yml b/.github/workflows/python-linters.yml index 2a7dfd6b88f..68b6a5d6715 100644 --- a/.github/workflows/python-linters.yml +++ b/.github/workflows/python-linters.yml @@ -68,21 +68,6 @@ jobs: - name: Log the list of packages run: python -m pip freeze --all - - name: 'Initialize tox envs: ${{ matrix.env.TOXENV }}' - run: >- - python -m - tox - --parallel auto - --notest - --skip-missing-interpreters false - env: ${{ matrix.env }} - - name: Pre-fetch pre-commit hooks - # This is to separate test step from deps install - if: matrix.env.TOXENV == 'lint' - run: >- - .tox/lint/${{ runner.os == 'Windows' && 'Scripts' || 'bin' }}/python -m - pre_commit - install-hooks - name: Test with tox run: >- python -m From 70ccb42c7f5d56f9ff2f08a5c892e9b1692b0bca Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 12:31:18 +0530 Subject: [PATCH 18/22] GitHub Actions: :art: Run checks with tox --- .github/workflows/python-linters.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-linters.yml b/.github/workflows/python-linters.yml index 68b6a5d6715..fb1c1490c37 100644 --- a/.github/workflows/python-linters.yml +++ b/.github/workflows/python-linters.yml @@ -68,9 +68,7 @@ jobs: - name: Log the list of packages run: python -m pip freeze --all - - name: Test with tox - run: >- - python -m - tox - --parallel auto + # Run checks with tox + - name: Run tox + run: python -m tox --parallel auto env: ${{ matrix.env }} From 0c8cbcadc3206023a4b0f0f4d11de4651b36e85a Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 21:45:30 +0530 Subject: [PATCH 19/22] GitHub Actions: Change to MacOS-only --- .../{python-linters.yml => macos.yml} | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) rename .github/workflows/{python-linters.yml => macos.yml} (84%) diff --git a/.github/workflows/python-linters.yml b/.github/workflows/macos.yml similarity index 84% rename from .github/workflows/python-linters.yml rename to .github/workflows/macos.yml index fb1c1490c37..1503241c164 100644 --- a/.github/workflows/python-linters.yml +++ b/.github/workflows/macos.yml @@ -1,4 +1,4 @@ -name: 🤖 +name: MacOS on: push: @@ -9,23 +9,13 @@ on: - cron: 2 18 * * 5 jobs: - linters: - name: @${{ matrix.os }} ${{ matrix.env.TOXENV }} - runs-on: ${{ matrix.os }}-latest - - strategy: - matrix: - os: - - ubuntu - - windows - - macos - env: - - TOXENV: docs - - TOXENV: lint - - TOXENV: vendoring + dev-tools: + name: Developer Tooling + runs-on: macos-latest env: TOX_PARALLEL_NO_SPINNER: 1 + TOXENV: lint,docs,vendoring steps: From 2dadcc918cdf9f1e520e0a1f344e134cbf3c51ca Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 21:53:50 +0530 Subject: [PATCH 20/22] docs: Update GitHub Actions CI usage --- docs/html/development/ci.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/html/development/ci.rst b/docs/html/development/ci.rst index 006542dd1b9..d0ea74a8ae9 100644 --- a/docs/html/development/ci.rst +++ b/docs/html/development/ci.rst @@ -68,7 +68,7 @@ provides free executors for open source packages: - `Travis CI`_ (Used for Linux) - `Azure DevOps CI`_ (Used for Windows) - - `GitHub Actions`_ (Linux, MacOS & Windows tests) + - `GitHub Actions`_ (Used for MacOS) .. _`Travis CI`: https://travis-ci.org/ .. _`Azure DevOps CI`: https://azure.microsoft.com/en-us/services/devops/ @@ -91,9 +91,9 @@ Developer tasks ======== =============== ================ ================== ============ OS docs lint vendoring packages ======== =============== ================ ================== ============ -Linux Travis, Github Travis, Github Travis, Github +Linux Travis Travis Travis Windows Azure Azure Azure Azure -MacOS +MacOS GitHub GitHub GitHub ======== =============== ================ ================== ============ Actual testing From 58de5198cf796183be3129859f5e89b0329f0df7 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 21:55:53 +0530 Subject: [PATCH 21/22] GitHub Actions: Remove reference to matrix --- .github/workflows/macos.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 1503241c164..f48010da05d 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -61,4 +61,3 @@ jobs: # Run checks with tox - name: Run tox run: python -m tox --parallel auto - env: ${{ matrix.env }} From f5f6c47e8bf8320579b3ed5b999343199a0deeb9 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Fri, 21 Feb 2020 22:00:49 +0530 Subject: [PATCH 22/22] GitHub Actions: Drop the tox parallelization --- .github/workflows/macos.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f48010da05d..4fbe34fba9e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -14,7 +14,6 @@ jobs: runs-on: macos-latest env: - TOX_PARALLEL_NO_SPINNER: 1 TOXENV: lint,docs,vendoring steps: @@ -60,4 +59,4 @@ jobs: # Run checks with tox - name: Run tox - run: python -m tox --parallel auto + run: python -m tox