2022-04-08 05:44:50 +00:00
|
|
|
---
|
|
|
|
name: CI
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: ["opened", "synchronize"]
|
|
|
|
push:
|
|
|
|
branches: ["devel"]
|
2023-03-29 22:46:57 +00:00
|
|
|
env:
|
|
|
|
POETRY_VERSION: 1.4.1
|
2022-04-08 05:44:50 +00:00
|
|
|
jobs:
|
|
|
|
Test:
|
2023-03-02 22:03:20 +00:00
|
|
|
name: Python ${{ matrix.python.version }}
|
2022-04-08 05:44:50 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
2023-03-02 22:03:20 +00:00
|
|
|
fail-fast: true
|
2022-04-08 05:44:50 +00:00
|
|
|
matrix:
|
|
|
|
python:
|
|
|
|
- version: "3.7"
|
|
|
|
toxenv: py37
|
|
|
|
- version: "3.8"
|
|
|
|
toxenv: py38
|
|
|
|
- version: "3.9"
|
|
|
|
toxenv: py39
|
|
|
|
- version: "3.10"
|
|
|
|
toxenv: py310
|
2023-03-29 22:46:29 +00:00
|
|
|
- version: "3.11"
|
|
|
|
toxenv: py311
|
2024-03-21 22:34:38 +00:00
|
|
|
- version: "3.12"
|
|
|
|
toxenv: py312
|
2022-04-08 05:44:50 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2023-03-02 22:03:20 +00:00
|
|
|
|
2024-03-21 22:28:27 +00:00
|
|
|
- name: Install Python 3.10
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.10"
|
|
|
|
|
2022-04-08 05:44:50 +00:00
|
|
|
- name: Install Python ${{ matrix.python.version }}
|
2023-03-02 22:03:20 +00:00
|
|
|
uses: actions/setup-python@v4
|
2022-04-08 05:44:50 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python.version }}
|
2023-03-02 22:03:20 +00:00
|
|
|
|
2022-04-08 05:44:50 +00:00
|
|
|
- name: Configure Job Cache
|
2023-03-02 22:03:20 +00:00
|
|
|
uses: actions/cache@v3
|
2022-04-08 05:44:50 +00:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/pip
|
|
|
|
~/.cache/pypoetry/cache
|
|
|
|
~/.poetry
|
|
|
|
# Including the hashed poetry.lock in the cache slug ensures that the cache
|
|
|
|
# will be invalidated, and thus all packages will be redownloaded, if the
|
|
|
|
# lockfile is updated
|
|
|
|
key: ${{ runner.os }}-${{ matrix.python.toxenv }}-${{ hashFiles('**/poetry.lock') }}
|
2023-03-02 22:03:20 +00:00
|
|
|
|
2022-04-08 05:44:50 +00:00
|
|
|
- name: Configure Path
|
|
|
|
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
2023-03-02 22:03:20 +00:00
|
|
|
|
2022-04-08 05:44:50 +00:00
|
|
|
- name: Configure Environment
|
|
|
|
run: .github/scripts/setup-env.sh
|
2023-03-02 22:03:20 +00:00
|
|
|
|
2022-04-08 05:44:50 +00:00
|
|
|
- name: Run Toxenv ${{ matrix.python.toxenv }}
|
|
|
|
run: poetry run tox -e ${{ matrix.python.toxenv }}
|
2023-03-02 22:03:20 +00:00
|
|
|
|
2022-04-08 05:44:50 +00:00
|
|
|
Check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
2023-03-02 22:03:20 +00:00
|
|
|
|
|
|
|
- name: Install Python 3.10
|
|
|
|
uses: actions/setup-python@v4
|
2022-04-08 05:44:50 +00:00
|
|
|
with:
|
2023-03-02 22:03:20 +00:00
|
|
|
python-version: "3.10"
|
|
|
|
|
2022-04-08 05:44:50 +00:00
|
|
|
- name: Configure Job Cache
|
2023-03-02 22:03:20 +00:00
|
|
|
uses: actions/cache@v3
|
2022-04-08 05:44:50 +00:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/pip
|
|
|
|
~/.cache/pypoetry/cache
|
|
|
|
~/.poetry
|
2023-03-02 22:03:20 +00:00
|
|
|
# Hardcoded 'py310' slug here lets this cache piggyback on the 'py310' cache
|
2022-04-08 05:44:50 +00:00
|
|
|
# that is generated for the tests above
|
2023-03-02 22:03:20 +00:00
|
|
|
key: ${{ runner.os }}-py310-${{ hashFiles('**/poetry.lock') }}
|
|
|
|
|
2022-04-08 05:44:50 +00:00
|
|
|
- name: Configure Path
|
|
|
|
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
|
2023-03-02 22:03:20 +00:00
|
|
|
|
2022-04-08 05:44:50 +00:00
|
|
|
- name: Configure Environment
|
|
|
|
run: .github/scripts/setup-env.sh
|
2023-03-02 22:03:20 +00:00
|
|
|
|
2022-04-08 05:44:50 +00:00
|
|
|
- name: Run Static Analysis Checks
|
|
|
|
run: poetry run tox -e static
|
2023-03-02 22:03:20 +00:00
|
|
|
|
2022-04-08 05:44:50 +00:00
|
|
|
- name: Run Static Analysis Checks (Tests)
|
|
|
|
run: poetry run tox -e static-tests
|
2023-03-02 22:03:20 +00:00
|
|
|
|
2022-04-08 05:44:50 +00:00
|
|
|
- name: Run Security Checks
|
|
|
|
run: poetry run tox -e security
|