chore(main): release 0.5.2 #628
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: "tests" } | |
- { python: "3.11", os: "ubuntu-latest", session: "bandit" } | |
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.3.0 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install needed tools | |
run: | | |
pip install --upgrade -r .github/workflows/constraints.txt | |
pip --version | |
- 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.2 | |
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 }} | |
- name: Upload coverage data | |
if: always() && matrix.session == 'tests' | |
uses: "actions/upload-artifact@v4.3.6" | |
with: | |
name: coverage-data | |
path: ".coverage.*" | |
coverage: | |
runs-on: ubuntu-latest | |
needs: tests | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Download coverage data | |
uses: actions/download-artifact@v4.1.8 | |
with: | |
name: coverage-data | |
path: ./ | |
- run: ls -R | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v5.0.7 | |
with: | |
files: .coverage.xml | |
verbose: true |