From bb38dd568ba4895795f97132d8981b2252dbab76 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Tue, 27 Oct 2020 01:32:49 +0530 Subject: [PATCH 1/5] Add GitHub Action based testing for MacOS --- .github/workflows/linting.yml | 1 - .github/workflows/macos.yml | 138 ++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/macos.yml diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 0ff16be64..ebe98fec7 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -19,7 +19,6 @@ jobs: os: - Ubuntu - Windows - - MacOS steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 000000000..75c2118ac --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,138 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + schedule: + # Run every Friday at 18:02 UTC + - cron: 2 18 * * 5 + +jobs: + dev-tools: + name: Quality Check / ${{ matrix.os }} + runs-on: ${{ matrix.os }}-latest + + strategy: + matrix: + os: [MacOS] + + steps: + # Caches + - name: pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('tools/requirements/tests.txt') }}-${{ hashFiles('tools/requirements/docs.txt') }}-${{ hashFiles('tox.ini') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - name: Set PY (for pre-commit cache) + run: echo "::set-env name=PY::$(python -c 'import hashlib, sys;print(hashlib.sha256(sys.version.encode()+sys.executable.encode()).hexdigest())')" + - name: pre-commit cache + uses: actions/cache@v1 + with: + path: ~/.cache/pre-commit + key: pre-commit|2020-02-14|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + + # Setup + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + + - name: Install tox + run: python -m pip install tox + + # Main check + - run: python -m tox -e "lint,docs" + + packaging: + name: Packaging / ${{ matrix.os }} + runs-on: ${{ matrix.os }}-latest + + strategy: + matrix: + os: [MacOS] + + steps: + # Caches + - name: pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('tools/requirements/tests.txt') }}-${{ hashFiles('tools/requirements/docs.txt') }}-${{ hashFiles('tox.ini') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + # Setup + - name: Set up git credentials + run: | + git config --global user.email "pypa-dev@googlegroups.com" + git config --global user.name "pip" + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install tox and nox + run: python -m pip install tox nox + + # Main check + - name: Check vendored packages + run: python -m tox -e "vendoring" + + - name: Prepare dummy release + run: nox -s prepare-release -- 99.9 + + - name: Generate distributions for the dummy release + run: nox -s build-release -- 99.9 + + tests: + name: Tests / ${{ matrix.python }} / ${{ matrix.os }} + runs-on: ${{ matrix.os }}-latest + + needs: dev-tools + + strategy: + fail-fast: false + matrix: + os: [MacOS] + python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] + + steps: + # Caches + - name: pip cache + uses: actions/cache@v1 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('tools/requirements/tests.txt') }}-${{ hashFiles('tools/requirements/docs.txt') }}-${{ hashFiles('tox.ini') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + # Setup + - uses: actions/checkout@v2 + - uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python }} + + - name: Install tox + run: python -m pip install tox 'virtualenv<20' + + # Main check + - name: Run unit tests + run: >- + python -m tox -e py -- + -m unit + --verbose + --numprocesses auto + + - name: Run integration tests + run: >- + python -m tox -e py -- + -m integration + --verbose + --numprocesses auto + --duration=5 From 3ccf8614fa76c6a7699c7304b663660e835a6b39 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Tue, 27 Oct 2020 01:33:03 +0530 Subject: [PATCH 2/5] Drop MacOS test runs for Azure Pipelines --- .azure-pipelines/macos.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.azure-pipelines/macos.yml b/.azure-pipelines/macos.yml index 9ad9edae8..537ac3efd 100644 --- a/.azure-pipelines/macos.yml +++ b/.azure-pipelines/macos.yml @@ -2,10 +2,6 @@ variables: CI: true jobs: -- template: jobs/test.yml - parameters: - vmImage: macos-10.14 - - template: jobs/package.yml parameters: vmImage: macos-10.14 From d4cde6cb107390502977c2fd51481e7c464243d3 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Tue, 27 Oct 2020 01:49:00 +0530 Subject: [PATCH 3/5] Fix typo --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 75c2118ac..20ae2f77e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -135,4 +135,4 @@ jobs: -m integration --verbose --numprocesses auto - --duration=5 + --durations=5 From 0e135407c759ee4e0e5e881f1686f14328a835f0 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Tue, 27 Oct 2020 02:10:36 +0530 Subject: [PATCH 4/5] Simplify YAML + better names --- .github/workflows/macos.yml | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 20ae2f77e..bdf3f671b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,4 +1,4 @@ -name: CI +name: MacOS on: push: @@ -11,12 +11,8 @@ on: jobs: dev-tools: - name: Quality Check / ${{ matrix.os }} - runs-on: ${{ matrix.os }}-latest - - strategy: - matrix: - os: [MacOS] + name: Quality Check + runs-on: macos-latest steps: # Caches @@ -39,7 +35,7 @@ jobs: # Setup - uses: actions/checkout@v2 - name: Set up Python 3.8 - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: 3.8 @@ -50,12 +46,8 @@ jobs: - run: python -m tox -e "lint,docs" packaging: - name: Packaging / ${{ matrix.os }} - runs-on: ${{ matrix.os }}-latest - - strategy: - matrix: - os: [MacOS] + name: Packaging + runs-on: macos-latest steps: # Caches @@ -74,7 +66,7 @@ jobs: git config --global user.name "pip" - uses: actions/checkout@v2 - name: Set up Python 3.8 - uses: actions/setup-python@v1 + uses: actions/setup-python@v2 with: python-version: 3.8 - name: Install tox and nox @@ -91,15 +83,14 @@ jobs: run: nox -s build-release -- 99.9 tests: - name: Tests / ${{ matrix.python }} / ${{ matrix.os }} - runs-on: ${{ matrix.os }}-latest + name: Tests / ${{ matrix.python }} + runs-on: macos-latest needs: dev-tools strategy: fail-fast: false matrix: - os: [MacOS] python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] steps: @@ -114,7 +105,7 @@ jobs: ${{ runner.os }}- # Setup - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python }} From 0608d2c5713b5ace57f013b99754942e04a6680c Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Tue, 27 Oct 2020 18:10:07 +0530 Subject: [PATCH 5/5] Remove the AP MacOS job --- .azure-pipelines/macos.yml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .azure-pipelines/macos.yml diff --git a/.azure-pipelines/macos.yml b/.azure-pipelines/macos.yml deleted file mode 100644 index 537ac3efd..000000000 --- a/.azure-pipelines/macos.yml +++ /dev/null @@ -1,7 +0,0 @@ -variables: - CI: true - -jobs: -- template: jobs/package.yml - parameters: - vmImage: macos-10.14