diff --git a/.github/workflows/docker-image-to-aws-ecr.yaml b/.github/workflows/docker-image-to-aws-ecr.yaml index 85612c6..2eb5fcd 100644 --- a/.github/workflows/docker-image-to-aws-ecr.yaml +++ b/.github/workflows/docker-image-to-aws-ecr.yaml @@ -1,4 +1,8 @@ +# # Deprecated for ecr-publish.yaml +# +# ================================= + name: Publish Docker image to AWS ECR diff --git a/.github/workflows/get-docker-tag.yaml b/.github/workflows/get-docker-tag.yaml index 5fa08b4..59108a4 100644 --- a/.github/workflows/get-docker-tag.yaml +++ b/.github/workflows/get-docker-tag.yaml @@ -1,4 +1,6 @@ # Deprecated for more generic get-version-tag.yaml +# +# ================================= name: Get-Docker-Tag on: diff --git a/.github/workflows/get-version-tag.yaml b/.github/workflows/get-version-tag.yaml index 427400c..088e9a9 100644 --- a/.github/workflows/get-version-tag.yaml +++ b/.github/workflows/get-version-tag.yaml @@ -1,3 +1,8 @@ +# +# Deprecated for ecr-publish.yaml +# +# ================================= + name: Get-Version-Tag on: workflow_call: diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml deleted file mode 100644 index 2f48ef1..0000000 --- a/.github/workflows/pre-commit.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: pre-commit - -on: [workflow_call] - -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-python@v5 - - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/qa-python.yaml b/.github/workflows/qa-python.yaml new file mode 100644 index 0000000..52e6196 --- /dev/null +++ b/.github/workflows/qa-python.yaml @@ -0,0 +1,53 @@ +name: QA Python + +on: + workflow_call: + inputs: + python_version: + description: 'Python version' + default: '3.13' + required: false + type: string + ruff_lint: + description: Use Ruff for linting + default: true + required: false + type: boolean + ruff_format: + description: Check formatting with Ruff + default: true + required: false + type: boolean + pyright: + description: Use Pyright for type checking + default: true + required: false + type: boolean + +jobs: + qa: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + + - name: Install uv + uses: astral-sh/setup-uv@v7 + with: + enable-cache: true + python-version: "${{ inputs.PYTHON_VERSION }}" + + - name: Install dependencies + run: uv sync --frozen --all-extras --dev + + - name: Ruff + if: inputs.ruff_lint + run: uv run ruff check + + - name: Ruff format check + if: inputs.ruff_format + run: uv run ruff format --check --diff + + - name: Pyright + if: inputs.pyright + run: uv run pyright \ No newline at end of file diff --git a/.pre-commit-config-python.yaml b/.pre-commit-config-python.yaml index a409752..5836f1e 100644 --- a/.pre-commit-config-python.yaml +++ b/.pre-commit-config-python.yaml @@ -9,19 +9,6 @@ repos: - id: check-merge-conflict - id: detect-private-key - - repo: https://github.com/pycqa/isort - rev: 5.13.2 - hooks: - - id: isort - name: isort python - args: [--check, --diff, --profile, black] - - - repo: https://github.com/psf/black - rev: 24.10.0 - hooks: - - id: black - args: [--check] - - repo: https://github.com/abravalheri/validate-pyproject rev: v0.24.1 hooks: @@ -31,8 +18,18 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.5.0 + rev: v0.14.14 hooks: # Run the linter. - - id: ruff - args: [--ignore, I001] + - id: ruff-check + args: [ --fix ] + # Run the formatter. + - id: ruff-format + + - repo: local + hooks: + - id: pyright + name: Pyright + language: unsupported + entry: bash -lc 'uv run pyright' + pass_filenames: false \ No newline at end of file diff --git a/README.md b/README.md index 10bf78a..c4022be 100644 --- a/README.md +++ b/README.md @@ -4,34 +4,20 @@ This repository contains workflows for GitHub actions used by the EO-DataHub. Th ``` jobs: - pre-commit-preparation: - name: Pre-commit - runs-on: ubuntu-latest - permissions: - contents: read - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-python@v3 - - - name: Copy config - run: | - if [ ! -f .pre-commit-config.yaml ]; then - curl -o .pre-commit-config.yaml https://raw.githubusercontent.com/EO-DataHub/github-actions/main/.pre-commit-config-python.yaml - fi - - - uses: pre-commit/action@v3.0.1 - security-scan: name: Call Security Scan permissions: contents: read uses: EO-DataHub/github-actions/.github/workflows/security.yaml@main + qa: + uses: EO-DataHub/github-actions/.github/workflows/qa-python.yaml@main + unit-tests: name: Run unit tests permissions: contents: read - uses: EO-DataHub/github-actions/.github/workflows/unit-tests-python.yaml@main + uses: EO-DataHub/github-actions/.github/workflows/unit-tests-python-uv.yaml@main with: PYTHON_VERSION: "3.12" ``` \ No newline at end of file