From: Shane Jaroch Date: Sat, 17 Jan 2026 08:24:56 +0000 (-0500) Subject: separate/organized workflows; fix lints. X-Git-Url: https://git.nutra.tk/v1?a=commitdiff_plain;h=8607240e2ffc49f95aaf6a478736ed2c65789a61;p=gamesguru%2Fgit-remote-gcrypt.git separate/organized workflows; fix lints. --- diff --git a/.github/workflows/compatibility.yaml b/.github/workflows/compatibility.yaml index f0fc56e..c9ea0e9 100644 --- a/.github/workflows/compatibility.yaml +++ b/.github/workflows/compatibility.yaml @@ -1,20 +1,21 @@ -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 @@ -24,10 +25,10 @@ jobs: - 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 diff --git a/.github/workflows/lint.yaml b/.github/workflows/install.yml similarity index 77% copy from .github/workflows/lint.yaml copy to .github/workflows/install.yml index 162f64e..2672054 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/install.yml @@ -1,7 +1,7 @@ --- -name: lint +name: install -"on": +on: push: workflow_dispatch: inputs: @@ -89,29 +89,26 @@ jobs: - 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" diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 162f64e..a347395 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -13,83 +13,7 @@ name: lint 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: diff --git a/.github/workflows/termux-android.yml b/.github/workflows/termux-android.yml deleted file mode 100644 index 465f904..0000000 --- a/.github/workflows/termux-android.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -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" diff --git a/install.sh b/install.sh index db7d363..6599d41 100755 --- a/install.sh +++ b/install.sh @@ -3,7 +3,7 @@ set -e # 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 diff --git a/tests/installer-test-logic.sh b/tests/installer-test-logic.sh index 9bb21b0..73b6673 100755 --- a/tests/installer-test-logic.sh +++ b/tests/installer-test-logic.sh @@ -214,16 +214,9 @@ mkdir -p "$TERMUX_PREFIX/share/man/man1" 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