Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
zhPavel committed Dec 10, 2023
1 parent a03cf61 commit dd8fe50
Show file tree
Hide file tree
Showing 15 changed files with 299 additions and 195 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Run tests

on:
push:
branches:
- "3.x/*"
pull_request:
branches:
- "3.x/*"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
linting:
name: Run linters
runs-on: ubuntu-latest
timeout-minutes: 3

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install Just
uses: extractions/setup-just@v1
with:
just-version: 1.14.0

- name: Setup environment to run tox
run:
just setup-runner

- name: Run linters
run:
just lint

testing:
name: Run tests
runs-on: ${{ matrix.os }}
needs: linting

strategy:
fail-fast: true
matrix:
python_version:
- { setup: '3.8', tox: 'py38' }
- { setup: '3.9', tox: 'py39' }
- { setup: '3.10', tox: 'py310' }
- { setup: '3.11', tox: 'py311' }
- { setup: 'pypy3.8', tox: 'pypy38' }
- { setup: 'pypy3.9', tox: 'pypy39' }
- { setup: 'pypy3.10', tox: 'pypy310' }

os: [ ubuntu-latest ]

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version.setup }}

- name: Install Just
uses: extractions/setup-just@v1
with:
just-version: 1.14.0

- name: Setup environment to run tox
run:
just setup-runner

- name: Run tests
run:
just test-on-python-version ${{ matrix.python_version.tox }}
79 changes: 0 additions & 79 deletions .github/workflows/setup.yml

This file was deleted.

62 changes: 0 additions & 62 deletions Makefile

This file was deleted.

52 changes: 52 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[private]
@default:
just --list

@bootstrap:
pip install -r requirements/pre.txt
pip install -e .
pip install -r requirements/dev.txt
pre-commit
pre-commit install

@venv-sync:
pip-sync requirements/pre.txt requirements/dev.txt
pip install -e .

@setup-runner:
pip install -r requirements/pre.txt
pip install -r requirements/runner.txt

@lint:
tox -e lint

@test:
tox -e $(tox list --no-desc | grep '^py' | grep 'new$' | tr '\n' ',')

@test-all:
tox -e $(tox list --no-desc | grep '^py' | sort -r | tr '\n' ',')

@test-all-p:
tox -e $(tox list --no-desc | grep '^py' | sort -r | tr '\n' ',') -p auto

@test-on-python-version target:
tox -e $(tox list --no-desc | grep '^{{ target }}' | sort -r | tr '\n' ',')

@cov:
inv cov

@deps-compile:
inv deps-compile

doc_source := "docs"
doc_target := "docs-build"

@doc:
sphinx-build -M html {{ doc_source }} {{ doc_target }}
echo "Open file://`pwd`/{{ doc_target }}/html/index.html"

@doc-clean:
sphinx-build -M clean {{ doc_source }} {{ doc_target }}

@doc-open:
nohup python -m webbrowser -t "file://`pwd`/docs-build/html/index.html" > /dev/null
2 changes: 1 addition & 1 deletion requirements/bench.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --allow-unsafe --output-file=requirements/bench.txt --strip-extras requirements/raw/bench.txt
Expand Down
Loading

0 comments on commit dd8fe50

Please sign in to comment.