From 1013b0ff84e613bd64822830e6cdf9437a0310a0 Mon Sep 17 00:00:00 2001 From: Peter Adrichem Date: Sat, 4 Jan 2025 21:49:36 +0100 Subject: [PATCH] Python code checks (GitHub Action). --- .../{python-package.yml => code-checks.yml} | 16 ++++++---------- README.rst | 4 ++++ docs/index.rst | 4 ++++ pyproject.toml | 2 +- 4 files changed, 15 insertions(+), 11 deletions(-) rename .github/workflows/{python-package.yml => code-checks.yml} (60%) diff --git a/.github/workflows/python-package.yml b/.github/workflows/code-checks.yml similarity index 60% rename from .github/workflows/python-package.yml rename to .github/workflows/code-checks.yml index b7a94ef..5942828 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/code-checks.yml @@ -1,7 +1,4 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - -name: Python package +name: code checks on: push: @@ -9,21 +6,20 @@ on: pull_request: branches: [ "main" ] +permissions: + contents: read + jobs: build: runs-on: ubuntu-latest - strategy: - fail-fast: true - matrix: - python-version: ["3.9", "3.11", "3.13"] steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} + - name: Set up Python 3.9 uses: actions/setup-python@v5 with: - python-version: ${{ matrix.python-version }} + python-version: "3.9" cache: 'pip' - name: Install dependencies run: | diff --git a/README.rst b/README.rst index 5b66aea..4e318e8 100644 --- a/README.rst +++ b/README.rst @@ -22,6 +22,10 @@ Xul -- XML Utilities :target: https://xul.readthedocs.io/en/stable/ :alt: Documentation +.. image:: https://github.com/peteradrichem/Xul/actions/workflows/code-checks.yml/badge.svg + :target: https://github.com/peteradrichem/Xul/ + :alt: Code checks + Xul is a set of XML scripts written in Python. Documentation can be found on `Read The Docs`_. diff --git a/docs/index.rst b/docs/index.rst index e2630fb..1434038 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -25,6 +25,10 @@ Current version: |release| :target: https://xul.readthedocs.io/en/stable/ :alt: Documentation +.. image:: https://github.com/peteradrichem/Xul/actions/workflows/code-checks.yml/badge.svg + :target: https://github.com/peteradrichem/Xul/ + :alt: Code checks + .. index:: single: scripts diff --git a/pyproject.toml b/pyproject.toml index bef1a1a..d92ce0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ test = [ "isort~=5.13.2", "lxml-stubs~=0.5.1", "mypy~=1.14.1", - "ruff~=0.8.5", + "ruff~=0.8.6", "types-Pygments~=2.18", ] syntax = [