-name: Compatibility
+---
+name: compat
on:
- push:
pull_request:
schedule:
- cron: "0 0 * * 0" # Weekly on Sundays
jobs:
- # Test across different Ubuntu versions to verify git compatibility
git-versions:
name: Git Compatibility (${{ matrix.os }})
runs-on: ${{ matrix.os }}
+
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-latest]
+
steps:
- uses: actions/checkout@v4
- name: Install dependencies
- name: Run Tests
run: make test
- # Verify generated shell completions are actually valid syntax in their respective shells
shell-syntax:
name: Shell Completion Syntax
runs-on: ubuntu-latest
+
steps:
- uses: actions/checkout@v4
- name: Install Shells
---
-name: lint
+name: install
-"on":
+on:
push:
workflow_dispatch:
inputs:
- name: Verify [make check/install]
run: make check/install
- # Lint job
- lint:
+ # Handles Termux (Android shell)
+ termux-android:
runs-on: ubuntu-latest
+
steps:
- uses: actions/checkout@v4
- - name: Install ShellCheck
- run: sudo apt-get update && sudo apt-get install -y shellcheck
-
- - name: Lint [make lint]
- run: make lint
-
- - name: Check Formatting [make format]
- # Requires shfmt and black.
- # Assuming environment has them or we install them.
- # ubuntu-latest has python3, we need shfmt.
- run: |
- sudo snap install shfmt
- pip3 install black
- make format
- git diff --exit-code
+ - name: Fix permissions for Docker
+ run: chmod -R u+rwX,go+rX .
- - name: Check Generation [make generate]
+ - name: Run tests in Termux
run: |
- make generate
- git diff --exit-code
+ docker run --rm \
+ -v "$PWD":/app \
+ -w /app \
+ termux/termux-docker:latest \
+ /system/bin/sh -c "export PATH=/data/data/com.termux/files/usr/bin:\$PATH; \
+ apt-get update && \
+ apt-get install -y git make bash python man && \
+ pip install docutils && \
+ make install && \
+ make check/install && \
+ git-remote-gcrypt --version"
schedule:
- cron: "0 0 * * 0" # Sunday at 12 AM
-permissions:
- contents: read
-
jobs:
- # Handles Ubuntu and macOS
- install-unix:
- runs-on: ${{ matrix.os }}
-
- env:
- GCRYPT_DEBUG: ${{ inputs.debug && '1' || '' }}
-
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-latest, macos-latest]
-
- steps:
- - uses: actions/checkout@v4
-
- - name: Dependencies (Linux)
- if: runner.os == 'Linux'
- run: sudo apt-get update && sudo apt-get install -y git python3-docutils
-
- - name: Dependencies (macOS)
- if: runner.os == 'macOS'
- run: brew install coreutils python3 git docutils
-
- - name: Help [make]
- run: make
-
- - name: Test Installer
- run: bash ./tests/installer-test-logic.sh
-
- - name: Install [make install]
- run: sudo make install
-
- - name: Verify [make check/install]
- run: make check/install
-
- # Handles RedHat (UBI Container)
- install-rh:
- runs-on: ubuntu-latest
-
- env:
- GCRYPT_DEBUG: ${{ inputs.debug && '1' || '' }}
-
- container:
- image: registry.access.redhat.com/ubi9/ubi:latest
-
- steps:
- - uses: actions/checkout@v4
-
- # dnf is slow in containers. We cache the dnf cache directory.
- - name: Cache DNF
- uses: actions/cache@v4
- with:
- path: /var/cache/dnf
- key: ${{ runner.os }}-ubi9-dnf-v1
- restore-keys: |
- ${{ runner.os }}-ubi9-dnf-
-
- - name: Dependencies [redhat]
- run: dnf install -y git python3-docutils make man-db
-
- - name: Help [make]
- run: make
-
- - name: Test Installer
- run: bash ./tests/installer-test-logic.sh
-
- - name: Install [make install]
- run: make install # container runs as sudo
-
- - name: Verify [make check/install]
- run: make check/install
-
- # Lint job
lint:
runs-on: ubuntu-latest
steps:
+++ /dev/null
----
-name: Termux
-
-"on":
- push:
- schedule:
- - cron: "0 0 * * 0" # Sunday at 12 AM
-
-jobs:
- test:
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v4
-
- - name: Fix permissions for Docker
- run: chmod -R u+rwX,go+rX .
-
- - name: Run tests in Termux
- run: |
- docker run --rm \
- -v "$PWD":/app \
- -w /app \
- termux/termux-docker:latest \
- /system/bin/sh -c "export PATH=/data/data/com.termux/files/usr/bin:\$PATH; \
- apt-get update && \
- apt-get install -y git make bash python man && \
- pip install docutils && \
- make install && \
- make check/install && \
- git-remote-gcrypt --version"
# Auto-detect Termux: if /usr/local doesn't exist but $PREFIX does (Android/Termux)
if [ -z "${prefix:-}" ]; then
- if [ -d /usr/local ]; then
+ if [ -d "${_USR_LOCAL:-/usr/local}" ]; then
prefix=/usr/local
elif [ -n "${PREFIX:-}" ] && [ -d "$PREFIX" ]; then
# Termux sets $PREFIX to /data/data/com.termux/files/usr
unset prefix
unset DESTDIR
-# Mock /usr/local as nonexistent by using a wrapper that interprets [ -d /usr/local ]
-# Since we can't truly hide /usr/local, we modify the installer call to point elsewhere
-# We copy the installer (breaking symlink) and patch it to check a nonexistent path instead of /usr/local
-
-rm -f "$INSTALLER"
-sed 's|/usr/local|/non/existent/path|g' "$REPO_ROOT/install.sh" >"$INSTALLER"
-chmod +x "$INSTALLER"
-
# Run with PREFIX set but explicit prefix unset
-if PREFIX="$TERMUX_PREFIX" bash "$INSTALLER" >.install_log 2>&1; then
+# Mock /usr/local via _USR_LOCAL override
+if _USR_LOCAL="/non/existent/path" PREFIX="$TERMUX_PREFIX" bash "$INSTALLER" >.install_log 2>&1; then
if [ -f "$TERMUX_PREFIX/bin/git-remote-gcrypt" ]; then
printf " ✓ %s\n" "Termux PREFIX auto-detection works"
else