Skip to content

chore: add ruff-format (#100) #308

chore: add ruff-format (#100)

chore: add ruff-format (#100) #308

Workflow file for this run

name: tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- 'windows-latest'
- 'ubuntu-latest'
python:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
include:
- os: macos-13
python: '3.7'
- os: macos-14
python: '3.12'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up target Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Pick environment to run
run: |
import platform; import os; import sys; import codecs
base = '.'.join(map(str, sys.version_info[:2]))
env = f'BASE={base}\n'
print(f'Picked:\n{env}for{sys.version}')
with codecs.open(os.environ['GITHUB_ENV'], 'a', 'utf-8') as file_handler:
file_handler.write(env)
shell: python
- name: Set up Python for nox
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install nox
run: |
python -m pip install nox
nox --version
- name: Run tests
run: nox -s test-${{ env.BASE }}
- name: Send coverage report
uses: codecov/codecov-action@v1
env:
PYTHON: ${{ matrix.python }}
with:
flags: tests
env_vars: PYTHON
name: ${{ matrix.python }}
# https://github.com/marketplace/actions/alls-green#why
required-checks-pass: # This job does nothing and is only used for the branch protection
if: always()
needs:
- pytest
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}