chore(main): release 0.4.4 #2090
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: Tests | |
on: | |
- push | |
jobs: | |
tests: | |
name: ${{ matrix.session }} ${{ matrix.python }} / ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { python: "3.11", os: "ubuntu-latest", session: "pre-commit" } | |
- { python: "3.11", os: "ubuntu-latest", session: "safety" } | |
- { python: "3.12", os: "ubuntu-latest", session: "tests" } | |
- { python: "3.11", os: "ubuntu-latest", session: "tests" } | |
- { python: "3.10", os: "ubuntu-latest", session: "tests" } | |
- { python: "3.9", os: "ubuntu-latest", session: "tests" } | |
- { python: "3.8", os: "ubuntu-latest", session: "tests" } | |
- { python: "3.11", os: "ubuntu-latest", session: "xdoctest" } | |
- { python: "3.11", os: "ubuntu-latest", session: "docs-build" } | |
env: | |
NOXSESSION: ${{ matrix.session }} | |
FORCE_COLOR: "1" | |
PRE_COMMIT_COLOR: "always" | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5.2.0 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install needed tools | |
run: | | |
pip install --upgrade pip nox poetry virtualenv toml --constraint=.github/workflows/constraints.txt | |
pip --version | |
# separate out nox-poetry until it gets a released version with support for 1.8 | |
pip install --upgrade nox-poetry --constraint=.github/workflows/constraints.txt | |
- name: Compute pre-commit cache key | |
if: matrix.session == 'pre-commit' | |
id: pre-commit-cache | |
shell: python | |
run: | | |
import hashlib | |
import sys | |
import os | |
python = "py{}.{}".format(*sys.version_info[:2]) | |
payload = sys.version.encode() + sys.executable.encode() | |
digest = hashlib.sha256(payload).hexdigest() | |
result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8]) | |
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: | |
fh.write(f"result={result}\n") | |
- name: Restore pre-commit cache | |
uses: actions/cache@v4.1.1 | |
if: matrix.session == 'pre-commit' | |
with: | |
path: ~/.cache/pre-commit | |
key: ${{ steps.pre-commit-cache.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }} | |
restore-keys: | | |
${{ steps.pre-commit-cache.outputs.result }}- | |
- name: Run Nox | |
run: | | |
nox --force-color --python=${{ matrix.python }} |