mirror of
https://github.com/theupdateframework/python-tuf
synced 2026-05-24 10:08:28 +00:00
Configure workflow to run all tox environments, where each 'py' env runs on linux, macos and windows, and sslib master and lint builds run only Linux/Python3.x only. The workflow also configures pip caching. TODO: Adopt publishing of coverage (coveralls) and license (fossa) data from .travis.yml. Co-authored-by: Jussi Kukkonen <jkukkonen@vmware.com> Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
name: Run TUF tests and linter
|
|
|
|
on: [push, pull_request, workflow_dispatch]
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
# Run regular TUF tests on each OS/Python combination, plus special tests
|
|
# (sslib master) and linters on Linux/Python3.x only.
|
|
matrix:
|
|
python-version: [2.7, 3.6, 3.7, 3.8, 3.9]
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
toxenv: [py]
|
|
include:
|
|
- python-version: 3.x
|
|
os: ubuntu-latest
|
|
toxenv: with-sslib-master
|
|
experimental: true
|
|
# TODO: Change to 3.x once pylint fully supports Python 3.9
|
|
- python-version: 3.8
|
|
os: ubuntu-latest
|
|
toxenv: lint
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- name: Checkout TUF
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Find pip cache dir
|
|
id: pip-cache
|
|
run: echo "::set-output name=dir::$(pip cache dir)"
|
|
|
|
- name: pip cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
# Use the os dependent pip cache directory found above
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
|
# A match with 'key' counts as cache hit
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('requirements*.txt') }}
|
|
# A match with 'restore-keys' is used as fallback
|
|
restore-keys: ${{ runner.os }}-pip-
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
python -m pip install tox
|
|
|
|
- name: Run tox
|
|
run: tox -e ${{ matrix.toxenv }}
|