Skip to content
Merged
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
10 changes: 8 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
version: 2
enable-beta-ecosystems: true
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
interval: monthly
cooldown:
default-days: 7
groups:
github-actions:
patterns: ["*"]

- package-ecosystem: pre-commit
directory: "/"
schedule:
interval: monthly
cooldown:
default-days: 7
groups:
pre-commit:
patterns: ["*"]
3 changes: 2 additions & 1 deletion .github/workflows/alpine-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ jobs:
adduser runner docker
shell: sh -exo pipefail {0} # Run this as root, not the "runner" user.

- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false

- name: Set workspace ownership
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/backend-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"
- name: Ensure Git 2.52 or newer
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
>> "$GITHUB_STEP_SUMMARY"
- name: Retain raw timings and comparison
if: always()
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: backend-benchmark
path: benchmark-results/
12 changes: 8 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on:
schedule:
- cron: '27 10 * * 3'

permissions: {} # Expanded in the `analyze` job.

jobs:
analyze:
name: Analyze (${{ matrix.language }})
Expand All @@ -28,7 +30,7 @@ jobs:
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
security-events: write
security-events: write # Required for uploading SARIF to view in the Security tab.

strategy:
fail-fast: false
Expand All @@ -48,7 +50,9 @@ jobs:
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v7
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

# Add any setup steps before running the `github/codeql-action/init` action.
# This includes steps like installing compilers or runtimes (`actions/setup-node`
Expand All @@ -58,7 +62,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
Expand Down Expand Up @@ -90,6 +94,6 @@ jobs:
exit 1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
category: "/language:${{matrix.language}}"
5 changes: 3 additions & 2 deletions .github/workflows/cygwin-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ jobs:
git config --global core.autocrlf false # Affects the non-Cygwin git.
shell: pwsh # Do this outside Cygwin, to affect actions/checkout.

- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false

- name: Install Cygwin
uses: cygwin/cygwin-install-action@v6
uses: cygwin/cygwin-install-action@3f0a3f9f988f7e96b8c18098ae05eaec175f5b52 # v6.0.2
with:
packages: >-
curl gcc-core git libcurl-devel libexpat-devel libiconv-devel
Expand Down
26 changes: 18 additions & 8 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,49 @@ permissions:

jobs:
test:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
project: [smmap, gitdb]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.13t"]
include:
# setup-python has no builds of these versions for Ubuntu 26.04.
- python-version: "3.8"
os: ubuntu-24.04
- python-version: "3.9"
os: ubuntu-24.04

env:
PROJECT: ${{ matrix.project }}

steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
- uses: actions/setup-python@v7
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install test dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest flake8 ./smmap
if test "${{ matrix.project }}" = gitdb; then python -m pip install ./gitdb; fi
if test "$PROJECT" = gitdb; then python -m pip install ./gitdb; fi
- name: Lint
run: flake8 "${{ matrix.project }}/${{ matrix.project }}" --count --select=E9,F63,F7,F82 --show-source --statistics
run: flake8 "$PROJECT/$PROJECT" --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Test
run: |
if test "${{ matrix.project }}" = gitdb; then
if test "$PROJECT" = gitdb; then
GITDB_TEST_GIT_REPO_BASE="$(git rev-parse --git-common-dir)" pytest -o addopts= -v gitdb/gitdb/test
else
pytest -o addopts= -v smmap/smmap/test
fi
uv-sync:
runs-on: ubuntu-latest
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
project: [langchain, mlflow, bandit, swebench, datahub]
backend: [gix, cli]
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Ensure Git 2.52 or newer
Expand Down Expand Up @@ -48,4 +48,7 @@ jobs:
version: '0.12.13'
enable-cache: false
- name: Test latest release against this checkout
run: uv run test/downstream/run.py "${{ matrix.project }}" --backend "${{ matrix.backend }}"
env:
PROJECT: ${{ matrix.project }}
BACKEND: ${{ matrix.backend }}
run: uv run test/downstream/run.py "$PROJECT" --backend "$BACKEND"
9 changes: 6 additions & 3 deletions .github/workflows/git-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ jobs:
env:
GIT_PYTHON_BACKEND: cli
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: git/git
ref: v2.52.0
path: .git-source
- uses: actions/setup-python@v7
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: '3.12'
- name: Build minimum supported Git
Expand Down
35 changes: 32 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,39 @@ jobs:
runs-on: ubuntu-slim

steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: actions/setup-python@v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.x"

- uses: pre-commit/action@v3.0.1
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1

# Check that all `actions/checkout` in CI jobs have `persist-credentials: false`.
check-no-persist-credentials:
runs-on: ubuntu-slim

env:
GLOB: .github/workflows/*.@(yaml|yml)

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
sparse-checkout: ".github/workflows"
- name: List workflows to be scanned
run: |
shopt -s extglob
printf '%s\n' $GLOB # Pathname expansion in $GLOB intended.
- name: Scan workflows
run: |
shopt -s extglob
yq '.jobs.*.steps[]
| select(.uses == "actions/checkout@*" and .with.["persist-credentials"]? != false)
| {"file": filename, "line": line, "name": (.name // .uses)}
| .file + ":" + (.line | tostring) + ": " + .name
' -- $GLOB >query-output.txt # Pathname expansion in $GLOB intended.
cat query-output.txt
test -z "$(<query-output.txt)" # Report failure if we found anything.
27 changes: 20 additions & 7 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ jobs:
shell: bash --noprofile --norc -exo pipefail {0}

steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: ${{ matrix.experimental }}
Expand Down Expand Up @@ -97,7 +98,7 @@ jobs:

- name: Set up WSL (Windows)
if: matrix.os-type == 'windows'
uses: Vampire/setup-wsl@v7.2.0
uses: Vampire/setup-wsl@4c48163d9f981914dd8caa0fc335fe19cca5bff4 # v7.2.0
with:
wsl-version: 1

Expand Down Expand Up @@ -206,7 +207,6 @@ jobs:
continue-on-error: true

- name: Check types with mypy
if: matrix.python-version != '3.8'
run: |
mypy --python-version="${PYTHON_VERSION%t}" # Version only, with no "t" for free-threaded.
env:
Expand All @@ -232,7 +232,7 @@ jobs:

- name: Retain test results and backend operation counts
if: always()
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: tests-${{ matrix.os-type }}-${{ matrix.python-version }}-${{ matrix.backend }}
path: test-results/
Expand All @@ -251,11 +251,24 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.8", "3.9", "3.10"]
exclude:
# setup-python has no builds of these versions for Ubuntu 26.04.
- os: ubuntu-latest
python: "3.8"
- os: ubuntu-latest
python: "3.9"
include:
- os: ubuntu-24.04
python: "3.8"
- os: ubuntu-24.04
python: "3.9"
env:
GIT_PYTHON_BACKEND: cli
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ matrix.python }}
- name: Install the supported runtime
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: zizmor

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions: {} # Expanded in the `zizmor` job.

jobs:
zizmor:
runs-on: ubuntu-slim

permissions:
security-events: write # Required for uploading SARIF to view in the Security tab.
contents: read # Not needed in public repos. (Kept for private forks/reuploads.)
actions: read # Not needed in public repos. (Kept for private forks/reuploads.)

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: zizmorcore/zizmor-action@85b2b9fb8e3325e7a23d7d0a9d7ba5ae0f999e3e # v0.7.1
with:
persona: pedantic
5 changes: 5 additions & 0 deletions .github/zizmor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rules:
anonymous-definition:
disable: true
concurrency-limits:
disable: true
Loading