[SSPROD-28198] Update Jenkinsfile worker to amazon-linux2 #174
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "CI" | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
Lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install Linter | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 | |
- name: Lint Check | |
run: | | |
make lint | |
Tests: | |
runs-on: "${{ matrix.os }}" | |
needs: Lint | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
python-version: [3.6, 3.7, 3.8, 3.9] | |
exclude: | |
# conserve some osx builders | |
- python-version: 3.6 | |
os: macos-latest | |
# conserve some osx builders | |
- python-version: 3.9 | |
os: macos-latest | |
include: | |
- python-version: 3.6 | |
os: ubuntu-latest | |
tox-target: py36 | |
- python-version: 3.7 | |
os: ubuntu-latest | |
tox-target: py37 | |
- python-version: 3.8 | |
os: ubuntu-latest | |
tox-target: py38-cov | |
- python-version: 3.9 | |
os: ubuntu-latest | |
tox-target: py39 | |
- python-version: 3.7 | |
tox-target: py37 | |
os: macos-latest | |
- python-version: 3.8 | |
tox-target: py38 | |
os: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up cache | |
uses: actions/cache@v1 | |
with: | |
path: .tox/${{ matrix.tox-target }} | |
key: venv-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/requirement*.txt') }} | |
- name: Install Test Runner | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Install Deps | |
run: | | |
tox -e ${{ matrix.tox-target }} --notest | |
- name: Test | |
run: | | |
tox -vv -e ${{ matrix.tox-target }} | |
- name: Coverage Generate XML | |
if: contains(matrix.tox-target, 'py38-cov') | |
run: | | |
./.tox/${{ matrix.tox-target }}/bin/coverage xml && \ | |
bash <(curl -s https://codecov.io/bash) -Z \ | |
-v -f coverage.xml | |
Test-Windows: | |
# windows can't use the fast cache technique we use in our matrix builds | |
# where we cache the entire tox virtualenv directory, without error. | |
# instead we just cache the pip downloads, and install every time. | |
runs-on: windows-latest | |
needs: Lint | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v1 | |
with: | |
python-version: 3.7 | |
- name: Set up cache | |
uses: actions/cache@v1 | |
with: | |
path: ~\AppData\Local\pip\Cache | |
key: pip-${{ 3.8 }}-${{ hashFiles('**/requirement*.txt') }} | |
- name: Install Test Runner | |
run: | | |
python -m pip install pip | |
pip install tox codecov | |
- name: Install Deps | |
run: | | |
tox -e py37 --notest | |
- name: Test | |
run: | | |
tox -e py37 | |
Docs: | |
# todo, figure out how to fast cache the tox directory here. | |
runs-on: ubuntu-latest | |
needs: Lint | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v1 | |
with: | |
python-version: 3.8 | |
- name: Set up cache | |
uses: actions/cache@v1 | |
with: | |
path: "~/.cache/pip" | |
key: docs-${{ runner.os }}-${{ 3.8 }}-${{ hashFiles('**/requirement*.txt') }} | |
- name: Install Tox | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox | |
- name: Install Build Deps | |
run: | | |
TOXENV=docs tox --notest | |
- name: Build Docs | |
run: | | |
TOXENV=docs tox |