ci: check out via actions/checkout (repo is SHA-1, not SHA-256)
Run 110's lint job failed at checkout ("couldn't find remote ref <sha>")
because GIT_DEFAULT_HASH: sha256 — copied from the SHA-256 homeserver repo —
made git init create a SHA-256 repo that can't resolve this repo's SHA-1
commits. This overlay is a plain SHA-1 repo, so checkout needs no hash override.
- lint job: drop the bogus GIT_DEFAULT_HASH: sha256 override.
- build job: replace the curl+tar checkout with actions/checkout into
$GITHUB_WORKSPACE, registered with portage via repos.conf; pull dev-vcs/git
in Configure portage (stage3 has no git, which checkout shells out to) and
drop net-misc/curl (only the old checkout used it). QA scan / verify steps
now reference $GITHUB_WORKSPACE.
- CLAUDE.md: correct the SHA-256 claim and rewrite the CI section for the
two-job lint-gate + actions/checkout setup.
just lint passes; ci.yaml passes actionlint.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018MsAYv5RhNLE54fPrviVgS
This commit is contained in:
+11
-21
@@ -9,14 +9,7 @@ jobs:
|
|||||||
lint:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
# SHA-256 Gitea repo: actions/checkout's internal `git init` must also
|
|
||||||
# create a SHA-256 repo or the fetch-by-OID fails ("mismatched
|
|
||||||
# algorithms"). GIT_DEFAULT_HASH makes init match. (The build job below
|
|
||||||
# avoids checkout for the same SHA-256 reason but predates this
|
|
||||||
# workaround; its curl+tar still works, so it is left as-is.)
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
env:
|
|
||||||
GIT_DEFAULT_HASH: sha256
|
|
||||||
|
|
||||||
# setup-just fetches its binary from GitHub; on a Gitea runner the default
|
# setup-just fetches its binary from GitHub; on a Gitea runner the default
|
||||||
# github-token is the *Gitea* token (GitHub rejects it 401), so pass none
|
# github-token is the *Gitea* token (GitHub rejects it 401), so pass none
|
||||||
@@ -59,7 +52,8 @@ jobs:
|
|||||||
# pkgcore (pkgcheck) only reads /etc/portage/repos.conf, and the binhost
|
# pkgcore (pkgcheck) only reads /etc/portage/repos.conf, and the binhost
|
||||||
# needs the Gentoo release keys we don't ship — disable binpkg signature
|
# needs the Gentoo release keys we don't ship — disable binpkg signature
|
||||||
# verification (ephemeral CI container) so prebuilt deps like dev-lang/go
|
# verification (ephemeral CI container) so prebuilt deps like dev-lang/go
|
||||||
# can be pulled instead of compiled.
|
# can be pulled instead of compiled. dev-vcs/git is pulled here too because
|
||||||
|
# actions/checkout (next step) shells out to git, and stage3 has none.
|
||||||
- name: Configure portage
|
- name: Configure portage
|
||||||
run: |
|
run: |
|
||||||
mkdir -p /etc/portage/repos.conf
|
mkdir -p /etc/portage/repos.conf
|
||||||
@@ -67,26 +61,22 @@ jobs:
|
|||||||
> /etc/portage/repos.conf/gentoo.conf
|
> /etc/portage/repos.conf/gentoo.conf
|
||||||
sed -i '/^verify-signature/d' /etc/portage/binrepos.conf/gentoo.conf
|
sed -i '/^verify-signature/d' /etc/portage/binrepos.conf/gentoo.conf
|
||||||
printf '\nverify-signature = false\n' >> /etc/portage/binrepos.conf/gentoo.conf
|
printf '\nverify-signature = false\n' >> /etc/portage/binrepos.conf/gentoo.conf
|
||||||
emerge -q --getbinpkg net-misc/curl dev-util/pkgcheck
|
emerge -q --getbinpkg dev-vcs/git dev-util/pkgcheck
|
||||||
|
|
||||||
# Place this overlay at /var/db/repos/azy5030. actions/checkout is avoided
|
# Check out the overlay into the workspace (plain SHA-1 repo, so no
|
||||||
# (SHA-256 Gitea repos break it); curl + tar fetches the source archive.
|
# GIT_DEFAULT_HASH override), then register that path with portage.
|
||||||
- name: Check out overlay
|
- name: Check out overlay
|
||||||
env:
|
uses: actions/checkout@v4
|
||||||
TOKEN: ${{ github.token }}
|
|
||||||
|
- name: Register overlay with portage
|
||||||
run: |
|
run: |
|
||||||
host=${GITHUB_SERVER_URL#http://}; host=${host#https://}
|
printf '[azy5030]\nlocation = %s\nmasters = gentoo\nauto-sync = false\n' "$GITHUB_WORKSPACE" \
|
||||||
url="http://x-access-token:${TOKEN}@${host}/${GITHUB_REPOSITORY}/archive/${GITHUB_REF_NAME}.tar.gz"
|
|
||||||
curl -fsSL "$url" -o repo.tar.gz
|
|
||||||
mkdir -p /var/db/repos/azy5030
|
|
||||||
tar xzf repo.tar.gz -C /var/db/repos/azy5030 --strip-components=1
|
|
||||||
printf '[azy5030]\nlocation = /var/db/repos/azy5030\nmasters = gentoo\nauto-sync = false\n' \
|
|
||||||
> /etc/portage/repos.conf/azy5030.conf
|
> /etc/portage/repos.conf/azy5030.conf
|
||||||
mkdir -p /etc/portage/package.accept_keywords
|
mkdir -p /etc/portage/package.accept_keywords
|
||||||
echo 'dev-util/gitea-runner ~amd64' > /etc/portage/package.accept_keywords/gitea-runner
|
echo 'dev-util/gitea-runner ~amd64' > /etc/portage/package.accept_keywords/gitea-runner
|
||||||
|
|
||||||
- name: QA scan
|
- name: QA scan
|
||||||
run: pkgcheck scan --repo /var/db/repos/azy5030 dev-util/gitea-runner
|
run: pkgcheck scan --repo "$GITHUB_WORKSPACE" dev-util/gitea-runner
|
||||||
|
|
||||||
# Full source build: portage fetches the upstream source tarball and the
|
# Full source build: portage fetches the upstream source tarball and the
|
||||||
# vendor tarball (release asset), verifies them against the committed
|
# vendor tarball (release asset), verifies them against the committed
|
||||||
@@ -96,7 +86,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Verify binary
|
- name: Verify binary
|
||||||
run: |
|
run: |
|
||||||
ver=$(find /var/db/repos/azy5030/dev-util/gitea-runner -name 'gitea-runner-*.ebuild' \
|
ver=$(find "$GITHUB_WORKSPACE/dev-util/gitea-runner" -name 'gitea-runner-*.ebuild' \
|
||||||
| sed -E 's#.*/gitea-runner-(.*)\.ebuild#\1#' | sort -V | tail -1)
|
| sed -E 's#.*/gitea-runner-(.*)\.ebuild#\1#' | sort -V | tail -1)
|
||||||
gitea-runner --version
|
gitea-runner --version
|
||||||
gitea-runner --version | grep -q "v${ver}"
|
gitea-runner --version | grep -q "v${ver}"
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|||||||
A personal **Gentoo ebuild repository (overlay)**, repo name `azy5030`, EAPI 8,
|
A personal **Gentoo ebuild repository (overlay)**, repo name `azy5030`, EAPI 8,
|
||||||
`masters = gentoo`, thin + unsigned Manifests (`metadata/layout.conf`). It packages
|
`masters = gentoo`, thin + unsigned Manifests (`metadata/layout.conf`). It packages
|
||||||
software not in the main `::gentoo` tree. Currently one package:
|
software not in the main `::gentoo` tree. Currently one package:
|
||||||
`dev-util/gitea-runner`. Hosted on a self-hosted Gitea at `git.azy.dev` whose repos
|
`dev-util/gitea-runner`. Hosted on a self-hosted Gitea at `git.azy.dev`. (This repo
|
||||||
use SHA-256 object format.
|
is a standard SHA-1 repo; the sibling `homeserver` repo is SHA-256, so workflow
|
||||||
|
snippets copied from it may carry a `GIT_DEFAULT_HASH: sha256` checkout override
|
||||||
|
that this repo must *not* use.)
|
||||||
|
|
||||||
## The vendored-build model (the core design)
|
## The vendored-build model (the core design)
|
||||||
|
|
||||||
@@ -58,11 +60,14 @@ a Gentoo env with `go pkgdev git curl xz jq`.
|
|||||||
|
|
||||||
## CI (`.gitea/workflows/ci.yaml`)
|
## CI (`.gitea/workflows/ci.yaml`)
|
||||||
|
|
||||||
Runs on every push inside a `gentoo/stage3:amd64-openrc` container (the `runs-on` label
|
Runs on every push, two jobs. A **`lint`** job runs on the plain Docker-backend runner
|
||||||
only schedules onto the Docker-backend runner). Steps: `emerge-webrsync` to sync
|
(no container), checks out with `actions/checkout`, installs the linters, and runs
|
||||||
`::gentoo` → configure portage (disables binpkg signature verification so prebuilt deps
|
`just lint` (markdownlint/shellcheck/yamllint/actionlint). The **`build`** job has
|
||||||
like `dev-lang/go` are pulled, not compiled) → **check out via `curl + tar`, not
|
`needs: lint` (lint is a gate) and runs inside a `gentoo/stage3:amd64-openrc` container:
|
||||||
`actions/checkout`** (it breaks on SHA-256 Gitea repos) into `/var/db/repos/azy5030` →
|
`emerge-webrsync` to sync `::gentoo` → configure portage (disables binpkg signature
|
||||||
|
verification so prebuilt deps like `dev-lang/go` are pulled, not compiled; also pulls
|
||||||
|
`dev-vcs/git`, which `actions/checkout` needs and stage3 lacks) → `actions/checkout`
|
||||||
|
into `$GITHUB_WORKSPACE`, registered as the overlay via `repos.conf` →
|
||||||
`pkgcheck scan` → `emerge` → assert `gitea-runner --version` matches the ebuild version.
|
`pkgcheck scan` → `emerge` → assert `gitea-runner --version` matches the ebuild version.
|
||||||
|
|
||||||
## Conventions / gotchas
|
## Conventions / gotchas
|
||||||
|
|||||||
Reference in New Issue
Block a user