Skip to content
Closed
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
43 changes: 43 additions & 0 deletions .github/actions/uv-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Setup UV and Sync
description: 'Install uv and sync the dependencies'
inputs:
sync:
description: 'Whether to run `uv sync` after setting up.'
required: false
default: 'true'
type: boolean
dev:
description: 'Whether to use `--no-dev` with `uv sync`.'
required: false
default: 'true'
type: boolean
activate-environment:
description: 'Wether to activate the virtual env or not'
required: false
default: true
type: boolean
working-directory:
description: 'Use working-directory to run uv commands'
required: false
default: './'
type: string
runs:
using: 'composite'
steps:
- uses: astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
with:
version: "0.7.x"
activate-environment: ${{ inputs.activate-environment }}
working-directory: ${{ inputs.working-directory }}
- if: inputs.sync == 'true' && inputs.dev == 'false'
run: uv sync --frozen --no-dev
shell: bash
env:
FORCE_COLOR: "1"
working-directory: ${{ inputs.working-directory }}
- if: inputs.sync == 'true' && inputs.dev == 'true'
run: uv sync --frozen
shell: bash
env:
FORCE_COLOR: "1"
working-directory: ${{ inputs.working-directory }}
33 changes: 33 additions & 0 deletions .github/workflows/code-checkers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Static code checkers

on:
push:
branches:
- 'master'
paths:
- 'scripts/git-review-rebase/**'
pull_request:
paths:
- 'scripts/git-review-rebase/**'

permissions: {}

jobs:
git-review-rebase-code-check:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./scripts/git-review-rebase/
env:
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: ./.github/actions/uv-setup/
with:
working-directory: ./scripts/git-review-rebase/
- run: mypy --install-types --non-interactive .
- run: pyright
- run: ruff check
- run: flake8
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Create a release from tag

permissions: {}

on:
push:
tags:
- '*'
paths:
- 'scripts/git-review-rebase/**'

jobs:
build-git-review-rebase:
name: Build and store python artifacts
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./scripts/git-review-rebase/
permissions:
contents: read

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: ./.github/actions/uv-setup/
with:
working-directory: ./scripts/git-review-rebase/

- name: Build
run: uv build

- name: Store python distribution artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts
path: ./scripts/git-review-rebase/dist/

release-git-review-rebase:
permissions:
contents: write # allow creating a release

name: "Create and package a release"
runs-on: ubuntu-latest
needs: [build-git-review-rebase]
steps:
- name: Retrieve distribution artifacts
uses: actions/download-artifact@v4
with:
name: artifacts
path: ./scripts/git-review-rebase/dist/

- name: Create release ${{ github.ref_name }}
shell: bash
run: |
gh release create ${GITHUB_REF_NAME} --repo ${{ github.repository }} --generate-notes ./scripts/git-review-rebase/dist/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/requirements-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Check requirements file consistency

on:
push:
branches:
- 'master'
paths:
- 'scripts/git-review-rebase/**'
pull_request:
paths:
- 'scripts/git-review-rebase/**'

permissions: {}

jobs:
requirements-check:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./scripts/git-review-rebase/
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: ./.github/actions/uv-setup/
with:
dev: false
working-directory: ./scripts/git-review-rebase/
- run: ./requirements/update_requirements.py
- run: git diff --exit-code
29 changes: 29 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: GitHub Actions Security Analysis with zizmor 🌈

on:
push:
branches:
- 'master'
paths:
- 'scripts/git-review-rebase/**'
pull_request:
paths:
- 'scripts/git-review-rebase/**'

permissions: {}

jobs:
zizmor:
name: zizmor latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: ./.github/actions/uv-setup/
with:
sync: false
working-directory: ./scripts/git-review-rebase/
- run: uvx zizmor --color=always .
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 16 additions & 0 deletions scripts/git-review-rebase/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[flake8]
max-line-length = 100
extend-ignore = E203, W503
exclude =
.git,
__pycache__,
build,
dist,
.eggs,
*.egg-info,
.venv,
venv,
.tox

# E203: whitespace before ':' (conflicts with black)
# W503: line break before binary operator (conflicts with black)
90 changes: 90 additions & 0 deletions scripts/git-review-rebase/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
Pipfile.lock

# PEP 582
__pypackages__/

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# IDEs
.vscode/
.idea/
*.swp
*.swo
*~
Loading