Skip to content

Separate out Python 2.7 to use custom image #661

Separate out Python 2.7 to use custom image

Separate out Python 2.7 to use custom image #661

Workflow file for this run

name: Build
on:
push:
branches-ignore:
- 'release/*'
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-20.04
env:
# We use these variables to convert between tox and GHA version literals
py35: 3.5
py36: 3.6
py37: 3.7
py38: 3.8
py39: 3.9
strategy:
# ensures the entire test matrix is run, even if one permutation fails
fail-fast: false
matrix:
python-version: [py35, py36, py37, py38, py39]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python ${{ env[matrix.python-version] }}
uses: actions/setup-python@v2
with:
python-version: ${{ env[matrix.python-version] }}
- name: Install tox
# Pin tox 3 because of https://github.com/rpkilby/tox-factor/issues/18
run: pip install -U tox==3.27.1 tox-factor
- name: Cache tox environment
uses: actions/cache@v2
with:
path: .tox
# bump version prefix to fully reset caches
key: v1-tox-${{ matrix.python-version }}-${{ hashFiles('tox.ini', '**/setup.py') }}
- name: run tox
run: tox -f ${{ matrix.python-version }}
build-27:
runs-on: ubuntu-20.04
container:
image: python:2.7.18-buster
env:
py27: 2.7
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install tox
run: pip install -U tox==3.27.1 tox-factor
- name: Cache tox environment
uses: actions/cache@v2
with:
path: .tox
key: v1-tox-27-${{ hashFiles('tox.ini', '**/setup.py') }}
- name: Run tox for Python 2.7
run: tox -f py27