Improve CI Workflow.

Bump action versions, use poetry 1.2.0b2, Use py310 for static tests, Use better naming for python tests.
This commit is contained in:
Justin Wood 2022-07-08 15:18:14 -04:00 committed by Justin Wood
parent c8fd6e4fc0
commit e8ce2f391b
No known key found for this signature in database
GPG Key ID: E319AAE24BE41C3B
2 changed files with 25 additions and 11 deletions

View File

@ -8,7 +8,8 @@
set -e; set -e;
CI_CACHE=$HOME/.cache; CI_CACHE=$HOME/.cache;
POETRY_VERSION=1.1.12; POETRY_VERSION=1.2.0b2;
POETRY_PREVIEW=1;
mkdir --parents "$CI_CACHE"; mkdir --parents "$CI_CACHE";

View File

@ -7,12 +7,11 @@ on:
branches: ["devel"] branches: ["devel"]
jobs: jobs:
Test: Test:
name: Python ${{ matrix.python.version }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python: python:
- version: "3.6"
toxenv: py36
- version: "3.7" - version: "3.7"
toxenv: py37 toxenv: py37
- version: "3.8" - version: "3.8"
@ -21,15 +20,18 @@ jobs:
toxenv: py39 toxenv: py39
- version: "3.10" - version: "3.10"
toxenv: py310 toxenv: py310
fail-fast: true
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install Python ${{ matrix.python.version }} - name: Install Python ${{ matrix.python.version }}
uses: actions/setup-python@v1 uses: actions/setup-python@v4
with: with:
python-version: ${{ matrix.python.version }} python-version: ${{ matrix.python.version }}
- name: Configure Job Cache - name: Configure Job Cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/.cache/pip ~/.cache/pip
@ -39,38 +41,49 @@ jobs:
# will be invalidated, and thus all packages will be redownloaded, if the # will be invalidated, and thus all packages will be redownloaded, if the
# lockfile is updated # lockfile is updated
key: ${{ runner.os }}-${{ matrix.python.toxenv }}-${{ hashFiles('**/poetry.lock') }} key: ${{ runner.os }}-${{ matrix.python.toxenv }}-${{ hashFiles('**/poetry.lock') }}
- name: Configure Path - name: Configure Path
run: echo "$HOME/.local/bin" >> $GITHUB_PATH run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Configure Environment - name: Configure Environment
run: .github/scripts/setup-env.sh run: .github/scripts/setup-env.sh
- name: Run Toxenv ${{ matrix.python.toxenv }} - name: Run Toxenv ${{ matrix.python.toxenv }}
run: poetry run tox -e ${{ matrix.python.toxenv }} run: poetry run tox -e ${{ matrix.python.toxenv }}
Check: Check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install Python 3.8
uses: actions/setup-python@v1 - name: Install Python 3.10
uses: actions/setup-python@v4
with: with:
python-version: 3.8 python-version: "3.10"
- name: Configure Job Cache - name: Configure Job Cache
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: | path: |
~/.cache/pip ~/.cache/pip
~/.cache/pypoetry/cache ~/.cache/pypoetry/cache
~/.poetry ~/.poetry
# Hardcoded 'py38' slug here lets this cache piggyback on the 'py38' cache # Hardcoded 'py310' slug here lets this cache piggyback on the 'py38' cache
# that is generated for the tests above # that is generated for the tests above
key: ${{ runner.os }}-py38-${{ hashFiles('**/poetry.lock') }} key: ${{ runner.os }}-py310-${{ hashFiles('**/poetry.lock') }}
- name: Configure Path - name: Configure Path
run: echo "$HOME/.local/bin" >> $GITHUB_PATH run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Configure Environment - name: Configure Environment
run: .github/scripts/setup-env.sh run: .github/scripts/setup-env.sh
- name: Run Static Analysis Checks - name: Run Static Analysis Checks
run: poetry run tox -e static run: poetry run tox -e static
- name: Run Static Analysis Checks (Tests) - name: Run Static Analysis Checks (Tests)
run: poetry run tox -e static-tests run: poetry run tox -e static-tests
- name: Run Security Checks - name: Run Security Checks
run: poetry run tox -e security run: poetry run tox -e security