From 1c27cb9a0fbcba4be98a59923442dba0c9c791ed Mon Sep 17 00:00:00 2001 From: Andrey Rakhmatullin Date: Mon, 1 Apr 2024 16:31:49 +0500 Subject: [PATCH] CI improvements. --- .github/workflows/publish.yml | 4 ++-- .github/workflows/test.yml | 26 +++++--------------------- tox.ini | 19 +++++++++++++++++-- 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 84d62b5..35aca3e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,9 +13,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: '3.12' - name: Install dependencies diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bb0c03d..e46436e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,9 +26,9 @@ jobs: - python-version: '3.12' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -48,11 +48,11 @@ jobs: fail-fast: false matrix: python-version: ['3.12'] - tox-job: ["mypy", "docs"] + tox-job: ["mypy", "docs", "pre-commit", "twinecheck"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies @@ -62,19 +62,3 @@ jobs: - name: tox run: | tox -e ${{ matrix.tox-job }} - - pre-commit: - runs-on: ubuntu-latest - strategy: - fail-fast: false - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install pre-commit - - name: pre-commit linters - run: | - pre-commit install && pre-commit run --all-files diff --git a/tox.ini b/tox.ini index f4876e5..95b38ea 100644 --- a/tox.ini +++ b/tox.ini @@ -21,8 +21,8 @@ deps = [testenv:mypy] deps = mypy==0.910 - -commands = mypy --ignore-missing-imports --no-warn-no-return url_matcher tests +commands = + mypy --ignore-missing-imports --no-warn-no-return url_matcher tests [docs] changedir = docs @@ -35,3 +35,18 @@ changedir = {[docs]changedir} deps = {[docs]deps} commands = sphinx-build -W -b html . {envtmpdir}/html + +[testenv:pre-commit] +deps = + pre-commit +commands = + pre-commit run --all-files --show-diff-on-failure + +[testenv:twinecheck] +basepython = python3 +deps = + twine==5.0.0 + build==1.2.1 +commands = + python -m build --sdist + twine check dist/*