• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: CI
2
3on:
4  push:
5    branches:
6      - main
7  pull_request:
8    branches:
9      - main
10
11jobs:
12  test:
13    strategy:
14      matrix:
15        python-version: [
16          "2.7",
17          "3.5",
18          "3.6",
19          "3.7",
20          "3.8",
21          "3.9",
22          "3.10",
23          "3.11",
24          "3.12",
25          "3.13",
26          "pypy-2.7",
27          "pypy-3.8",
28        ]
29        os: [ubuntu-latest, windows-latest, macos-latest]
30        exclude:
31          - python-version: "2.7"
32            os: "ubuntu-latest"
33          - python-version: "2.7"
34            os: "windows-latest"
35          - python-version: "2.7"
36            os: "macos-latest"
37          - python-version: "3.5"
38            os: "macos-latest"
39          - python-version: "3.6"
40            os: "macos-latest"
41          - python-version: "3.7"
42            os: "macos-latest"
43          - python-version: "3.5"
44            os: "ubuntu-latest"
45          - python-version: "3.6"
46            os: "ubuntu-latest"
47        include:
48          - python-version: "3.5"
49            os: "macos-12"
50          - python-version: "3.6"
51            os: "macos-12"
52          - python-version: "3.7"
53            os: "macos-12"
54          - python-version: "2.7"
55            os: "ubuntu-20.04"
56          - python-version: "3.5"
57            os: "ubuntu-20.04"
58          - python-version: "3.6"
59            os: "ubuntu-20.04"
60    runs-on: ${{ matrix.os }}
61    env:
62      TOXENV: py
63    steps:
64      - uses: actions/checkout@v3
65      - if: ${{ matrix.python-version == '2.7' }}
66        run: |
67          sudo apt-get install python-is-python2
68          curl -sSL https://bootstrap.pypa.io/pip/2.7/get-pip.py -o get-pip.py
69          python get-pip.py
70        name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
71      - if: ${{ matrix.python-version != '2.7' }}
72        name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
73        uses: actions/setup-python@v5
74        with:
75          python-version: ${{ matrix.python-version }}
76          allow-prereleases: true
77        env:
78          PIP_TRUSTED_HOST: ${{ contains(fromJson('["3.5"]'), matrix.python-version) && 'pypi.python.org pypi.org files.pythonhosted.org' || '' }}
79      - name: Install dependencies
80        run: python -m pip install -U tox
81      - name: Run tox
82        run: python -m tox
83