Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/docker-image-to-aws-ecr.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#
# Deprecated for ecr-publish.yaml
#
# =================================


name: Publish Docker image to AWS ECR

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/get-docker-tag.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Deprecated for more generic get-version-tag.yaml
#
# =================================

name: Get-Docker-Tag
on:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/get-version-tag.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#
# Deprecated for ecr-publish.yaml
#
# =================================

name: Get-Version-Tag
on:
workflow_call:
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/pre-commit.yaml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/qa-python.yaml
Original file line number Diff line number Diff line change
@@ -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
29 changes: 13 additions & 16 deletions .pre-commit-config-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
22 changes: 4 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```