2021-04-02 00:48:39 +02:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-04-07 16:48:55 +02:00
|
|
|
branches: [main]
|
2021-04-02 00:48:39 +02:00
|
|
|
tags:
|
|
|
|
# Tags for all potential release numbers till 2030.
|
|
|
|
- "2[0-9].[0-3]" # 20.0 -> 29.3
|
|
|
|
- "2[0-9].[0-3].[0-9]+" # 20.0.0 -> 29.3.[0-9]+
|
|
|
|
pull_request:
|
|
|
|
schedule:
|
|
|
|
- cron: 0 0 * * MON # Run every Monday at 00:00 UTC
|
|
|
|
|
2022-01-25 21:03:15 +01:00
|
|
|
env:
|
|
|
|
# The "FORCE_COLOR" variable, when set to 1,
|
|
|
|
# tells Nox to colorize itself.
|
|
|
|
FORCE_COLOR: "1"
|
|
|
|
|
2021-12-03 15:37:04 +01:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-04-02 00:48:39 +02:00
|
|
|
jobs:
|
2021-09-18 10:12:45 +02:00
|
|
|
docs:
|
|
|
|
name: docs
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
- run: pip install nox
|
|
|
|
- run: nox -s docs
|
|
|
|
|
2021-04-02 00:48:39 +02:00
|
|
|
determine-changes:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
tests: ${{ steps.filter.outputs.tests }}
|
|
|
|
vendoring: ${{ steps.filter.outputs.vendoring }}
|
|
|
|
steps:
|
|
|
|
# For pull requests it's not necessary to checkout the code
|
|
|
|
- uses: dorny/paths-filter@v2
|
|
|
|
id: filter
|
|
|
|
with:
|
|
|
|
filters: |
|
|
|
|
vendoring:
|
|
|
|
# Anything that's touching "vendored code"
|
|
|
|
- "src/pip/_vendor/**"
|
|
|
|
- "pyproject.toml"
|
2022-07-23 18:09:04 +02:00
|
|
|
- "noxfile.py"
|
2021-04-02 00:48:39 +02:00
|
|
|
tests:
|
2022-01-14 11:40:13 +01:00
|
|
|
# Anything that's touching code-related stuff
|
2021-04-02 00:48:39 +02:00
|
|
|
- ".github/workflows/ci.yml"
|
|
|
|
- "src/**"
|
|
|
|
- "tests/**"
|
2022-07-23 18:09:04 +02:00
|
|
|
- "noxfile.py"
|
2021-04-24 11:00:54 +02:00
|
|
|
if: github.event_name == 'pull_request'
|
2021-04-02 00:48:39 +02:00
|
|
|
|
|
|
|
packaging:
|
|
|
|
name: packaging
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
- name: Set up git credentials
|
|
|
|
run: |
|
|
|
|
git config --global user.email "pypa-dev@googlegroups.com"
|
|
|
|
git config --global user.name "pip"
|
|
|
|
|
|
|
|
- run: pip install nox
|
|
|
|
- run: nox -s prepare-release -- 99.9
|
|
|
|
- run: nox -s build-release -- 99.9
|
2022-10-14 12:14:23 +02:00
|
|
|
- run: pipx run check-manifest
|
2021-04-02 00:48:39 +02:00
|
|
|
|
|
|
|
vendoring:
|
|
|
|
name: vendoring
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
needs: [determine-changes]
|
2021-04-17 16:33:58 +02:00
|
|
|
if: >-
|
|
|
|
needs.determine-changes.outputs.vendoring == 'true' ||
|
2021-04-24 11:00:54 +02:00
|
|
|
github.event_name != 'pull_request'
|
2021-04-02 00:48:39 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
|
2021-12-01 21:23:20 +01:00
|
|
|
- run: pip install nox
|
2021-12-01 19:22:29 +01:00
|
|
|
- run: nox -s vendoring
|
2021-04-02 00:48:39 +02:00
|
|
|
- run: git diff --exit-code
|
|
|
|
|
|
|
|
tests-unix:
|
|
|
|
name: tests / ${{ matrix.python }} / ${{ matrix.os }}
|
|
|
|
runs-on: ${{ matrix.os }}-latest
|
|
|
|
|
2022-10-07 13:04:14 +02:00
|
|
|
needs: [packaging, determine-changes]
|
2021-04-17 16:33:58 +02:00
|
|
|
if: >-
|
|
|
|
needs.determine-changes.outputs.tests == 'true' ||
|
2021-04-24 11:00:54 +02:00
|
|
|
github.event_name != 'pull_request'
|
2021-04-02 00:48:39 +02:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: true
|
|
|
|
matrix:
|
|
|
|
os: [Ubuntu, MacOS]
|
|
|
|
python:
|
|
|
|
- 3.7
|
|
|
|
- 3.8
|
|
|
|
- 3.9
|
2021-11-07 12:41:02 +01:00
|
|
|
- "3.10"
|
2021-04-02 00:48:39 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
|
|
|
|
2021-08-28 23:20:38 +02:00
|
|
|
- name: Install Ubuntu dependencies
|
|
|
|
if: matrix.os == 'Ubuntu'
|
|
|
|
run: sudo apt-get install bzr
|
|
|
|
|
|
|
|
- name: Install MacOS dependencies
|
|
|
|
if: matrix.os == 'MacOS'
|
|
|
|
run: brew install bzr
|
|
|
|
|
2022-01-31 19:52:29 +01:00
|
|
|
- run: pip install nox 'virtualenv<20' 'setuptools != 60.6.0'
|
2021-04-02 00:48:39 +02:00
|
|
|
|
|
|
|
# Main check
|
|
|
|
- name: Run unit tests
|
|
|
|
run: >-
|
2021-11-29 16:29:14 +01:00
|
|
|
nox -s test-${{ matrix.python }} --
|
2021-04-02 00:48:39 +02:00
|
|
|
-m unit
|
|
|
|
--verbose --numprocesses auto --showlocals
|
|
|
|
- name: Run integration tests
|
|
|
|
run: >-
|
2021-11-29 16:29:14 +01:00
|
|
|
nox -s test-${{ matrix.python }} --
|
2021-04-02 00:48:39 +02:00
|
|
|
-m integration
|
|
|
|
--verbose --numprocesses auto --showlocals
|
|
|
|
--durations=5
|
|
|
|
|
|
|
|
tests-windows:
|
|
|
|
name: tests / ${{ matrix.python }} / ${{ matrix.os }} / ${{ matrix.group }}
|
|
|
|
runs-on: ${{ matrix.os }}-latest
|
|
|
|
|
2022-10-07 13:04:14 +02:00
|
|
|
needs: [packaging, determine-changes]
|
2021-04-17 16:33:58 +02:00
|
|
|
if: >-
|
|
|
|
needs.determine-changes.outputs.tests == 'true' ||
|
2021-04-24 11:00:54 +02:00
|
|
|
github.event_name != 'pull_request'
|
2021-04-02 00:48:39 +02:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: true
|
|
|
|
matrix:
|
|
|
|
os: [Windows]
|
|
|
|
python:
|
2021-11-07 12:41:02 +01:00
|
|
|
- 3.7
|
2021-04-02 02:25:40 +02:00
|
|
|
# Commented out, since Windows tests are expensively slow.
|
|
|
|
# - 3.8
|
2021-11-12 09:04:57 +01:00
|
|
|
# - 3.9
|
2021-11-07 12:41:02 +01:00
|
|
|
- "3.10"
|
2021-04-02 00:48:39 +02:00
|
|
|
group: [1, 2]
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python }}
|
|
|
|
|
|
|
|
# We use a RAMDisk on Windows, since filesystem IO is a big slowdown
|
|
|
|
# for our tests.
|
|
|
|
- name: Create a RAMDisk
|
|
|
|
run: ./tools/ci/New-RAMDisk.ps1 -Drive R -Size 1GB
|
|
|
|
|
|
|
|
- name: Setup RAMDisk permissions
|
|
|
|
run: |
|
|
|
|
mkdir R:\Temp
|
|
|
|
$acl = Get-Acl "R:\Temp"
|
|
|
|
$rule = New-Object System.Security.AccessControl.FileSystemAccessRule(
|
|
|
|
"Everyone", "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow"
|
|
|
|
)
|
|
|
|
$acl.AddAccessRule($rule)
|
|
|
|
Set-Acl "R:\Temp" $acl
|
|
|
|
|
2021-11-29 16:29:14 +01:00
|
|
|
- run: pip install nox 'virtualenv<20'
|
2021-04-02 00:48:39 +02:00
|
|
|
env:
|
|
|
|
TEMP: "R:\\Temp"
|
|
|
|
|
|
|
|
# Main check
|
|
|
|
- name: Run unit tests
|
|
|
|
if: matrix.group == 1
|
|
|
|
run: >-
|
2021-11-29 16:29:14 +01:00
|
|
|
nox -s test-${{ matrix.python }} --
|
2021-04-02 00:48:39 +02:00
|
|
|
-m unit
|
|
|
|
--verbose --numprocesses auto --showlocals
|
|
|
|
env:
|
|
|
|
TEMP: "R:\\Temp"
|
|
|
|
|
|
|
|
- name: Run integration tests (group 1)
|
|
|
|
if: matrix.group == 1
|
|
|
|
run: >-
|
2021-11-29 16:29:14 +01:00
|
|
|
nox -s test-${{ matrix.python }} --
|
2021-04-02 00:48:39 +02:00
|
|
|
-m integration -k "not test_install"
|
|
|
|
--verbose --numprocesses auto --showlocals
|
|
|
|
env:
|
|
|
|
TEMP: "R:\\Temp"
|
|
|
|
|
|
|
|
- name: Run integration tests (group 2)
|
|
|
|
if: matrix.group == 2
|
|
|
|
run: >-
|
2021-11-29 16:29:14 +01:00
|
|
|
nox -s test-${{ matrix.python }} --
|
2021-04-02 00:48:39 +02:00
|
|
|
-m integration -k "test_install"
|
|
|
|
--verbose --numprocesses auto --showlocals
|
|
|
|
env:
|
|
|
|
TEMP: "R:\\Temp"
|
2021-12-05 01:36:04 +01:00
|
|
|
|
2022-07-12 11:28:34 +02:00
|
|
|
tests-zipapp:
|
|
|
|
name: tests / zipapp
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
2022-10-07 13:04:14 +02:00
|
|
|
needs: [packaging, determine-changes]
|
2022-07-12 11:28:34 +02:00
|
|
|
if: >-
|
|
|
|
needs.determine-changes.outputs.tests == 'true' ||
|
|
|
|
github.event_name != 'pull_request'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: "3.10"
|
|
|
|
|
|
|
|
- name: Install Ubuntu dependencies
|
|
|
|
run: sudo apt-get install bzr
|
|
|
|
|
|
|
|
- run: pip install nox 'virtualenv<20' 'setuptools != 60.6.0'
|
|
|
|
|
|
|
|
# Main check
|
|
|
|
- name: Run integration tests
|
|
|
|
run: >-
|
|
|
|
nox -s test-3.10 --
|
|
|
|
-m integration
|
|
|
|
--verbose --numprocesses auto --showlocals
|
|
|
|
--durations=5
|
|
|
|
--use-zipapp
|
|
|
|
|
2022-04-19 11:08:57 +02:00
|
|
|
# TODO: Remove this when we add Python 3.11 to CI.
|
2021-12-05 01:36:04 +01:00
|
|
|
tests-importlib-metadata:
|
|
|
|
name: tests for importlib.metadata backend
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2022-04-19 11:08:57 +02:00
|
|
|
_PIP_USE_IMPORTLIB_METADATA: 'true'
|
2021-12-05 01:36:04 +01:00
|
|
|
|
2022-10-07 13:04:14 +02:00
|
|
|
needs: [packaging, determine-changes]
|
2021-12-05 01:36:04 +01:00
|
|
|
if: >-
|
|
|
|
needs.determine-changes.outputs.tests == 'true' ||
|
|
|
|
github.event_name != 'pull_request'
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.10'
|
|
|
|
|
|
|
|
- name: Install Ubuntu dependencies
|
|
|
|
run: sudo apt-get install bzr
|
|
|
|
|
|
|
|
- run: pip install nox 'virtualenv<20'
|
|
|
|
|
|
|
|
- name: Run unit tests
|
|
|
|
run: >-
|
|
|
|
nox -s test-3.10 --
|
|
|
|
-m unit
|
|
|
|
--verbose --numprocesses auto --showlocals
|
|
|
|
- name: Run integration tests
|
|
|
|
run: >-
|
|
|
|
nox -s test-3.10 --
|
|
|
|
-m integration
|
|
|
|
--verbose --numprocesses auto --showlocals
|
|
|
|
--durations=5
|
2022-09-29 01:44:25 +02:00
|
|
|
|
|
|
|
check: # This job does nothing and is only used for the branch protection
|
|
|
|
if: always()
|
|
|
|
|
|
|
|
needs:
|
|
|
|
- determine-changes
|
|
|
|
- docs
|
|
|
|
- packaging
|
|
|
|
- tests-unix
|
|
|
|
- tests-windows
|
|
|
|
- tests-zipapp
|
|
|
|
- tests-importlib-metadata
|
|
|
|
- vendoring
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Decide whether the needed jobs succeeded or failed
|
|
|
|
uses: re-actors/alls-green@release/v1
|
|
|
|
with:
|
|
|
|
allowed-skips: >-
|
|
|
|
${{
|
|
|
|
(
|
|
|
|
needs.determine-changes.outputs.vendoring != 'true'
|
|
|
|
&& github.event_name == 'pull_request'
|
|
|
|
)
|
|
|
|
&& 'vendoring'
|
|
|
|
|| ''
|
|
|
|
}}
|
2022-09-29 10:24:48 +02:00
|
|
|
,
|
|
|
|
${{
|
|
|
|
(
|
|
|
|
needs.determine-changes.outputs.tests != 'true'
|
|
|
|
&& github.event_name == 'pull_request'
|
|
|
|
)
|
|
|
|
&& '
|
|
|
|
tests-unix,
|
|
|
|
tests-windows,
|
2022-09-29 14:54:42 +02:00
|
|
|
tests-zipapp,
|
|
|
|
tests-importlib-metadata,
|
2022-09-29 10:24:48 +02:00
|
|
|
'
|
|
|
|
|| ''
|
|
|
|
}}
|
2022-09-29 01:44:25 +02:00
|
|
|
jobs: ${{ toJSON(needs) }}
|