Skip to content

Commit b40be66

Browse files
hannahhowardclaude
andcommitted
Merge main (union .PHONY: keep gen-check + itest)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2 parents aae77be + b3e4d8f commit b40be66

197 files changed

Lines changed: 21373 additions & 3752 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# dirs
2+
.git
3+
.github
4+
.claude
5+
.idea
6+
7+
# files
8+
.env*
9+
*.md
10+
docker-compose*.yml
11+
compose*.yml
12+
LICENSE

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: "/"
10+
schedule:
11+
interval: weekly
12+
groups:
13+
github-actions:
14+
patterns:
15+
- "*"

.github/workflows/go-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ concurrency:
1515

1616
jobs:
1717
go-check:
18-
uses: ipdxco/unified-github-workflows/.github/workflows/go-check.yml@v1.0
18+
uses: ipdxco/unified-github-workflows/.github/workflows/go-check.yml@63392e900bbe802fb1a826ba763f6f543773dc36 # v1.0

.github/workflows/go-test.yml

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: Go Test
22

3+
# Two-stage test pipeline mirroring the local `make test` / `make itest`
4+
# split: fast unit tests run first (the shared unified workflow), and the
5+
# Docker-backed integration suite (itest/) only runs once they pass — a
6+
# broken unit test fails the PR in ~2 minutes instead of tying up a runner
7+
# booting the Forge stack.
8+
39
on:
410
pull_request:
511
push:
@@ -14,9 +20,71 @@ concurrency:
1420
cancel-in-progress: true
1521

1622
jobs:
17-
go-test:
18-
uses: ipdxco/unified-github-workflows/.github/workflows/go-test.yml@v1.0
23+
unit:
24+
uses: ipdxco/unified-github-workflows/.github/workflows/go-test.yml@63392e900bbe802fb1a826ba763f6f543773dc36 # v1.0
1925
with:
2026
go-versions: '["this"]'
2127
secrets:
2228
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
29+
30+
itest:
31+
needs: unit
32+
# Pin to 24.04 rather than -latest so the Docker version doesn't drift
33+
# from under us. The runner's preinstalled Docker is 28.x, well past
34+
# smelt's 25+ requirement.
35+
runs-on: ubuntu-24.04
36+
timeout-minutes: 25
37+
38+
steps:
39+
- name: Check out the repository
40+
uses: actions/checkout@v5
41+
42+
- name: Set up Go
43+
uses: actions/setup-go@v6
44+
with:
45+
go-version-file: go.mod
46+
47+
- name: Docker info
48+
run: |
49+
docker version
50+
docker compose version
51+
52+
- name: Run integration tests
53+
# GOWORK=off matches the Makefile convention (a parent go.work may
54+
# declare a newer Go than the toolchain). The harness builds the
55+
# working-tree binary itself (itest/stack_test.go).
56+
env:
57+
GOWORK: off
58+
run: go test -tags itest -v -timeout 20m ./itest
59+
60+
- name: Dump container state on failure
61+
if: failure()
62+
run: |
63+
mkdir -p /tmp/container-logs
64+
65+
{
66+
echo "=== docker ps -a ==="
67+
docker ps -a
68+
echo
69+
echo "=== docker network ls ==="
70+
docker network ls
71+
echo
72+
echo "=== docker volume ls ==="
73+
docker volume ls
74+
} | tee /tmp/container-logs/_overview.txt
75+
76+
for c in $(docker ps -a --format '{{.Names}}'); do
77+
docker logs "$c" > "/tmp/container-logs/$c.log" 2>&1 || true
78+
echo "::group::$c"
79+
tail -200 "/tmp/container-logs/$c.log"
80+
echo "::endgroup::"
81+
done
82+
83+
- name: Upload container logs
84+
if: failure()
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: container-logs
88+
path: /tmp/container-logs/
89+
if-no-files-found: ignore
90+
retention-days: 7

.github/workflows/publish-ghcr.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Container
2+
3+
# Build the ingot daemon image and publish it to GHCR on merges to main.
4+
# Mirrors sprue's dev/prod pattern so smelt can pull a consistent
5+
# ghcr.io/fil-forge/ingot:main (prod) and :main-dev (debug + dlv) pair.
6+
# ingot has no releaser, so this is the PR build-check + publish-on-main
7+
# half of sprue's workflow.
8+
9+
on:
10+
push:
11+
branches: [main]
12+
pull_request:
13+
branches: [main]
14+
15+
# Cancel in-progress runs on new pushes to the same ref.
16+
concurrency:
17+
group: container-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
env:
21+
REGISTRY: ghcr.io
22+
IMAGE_NAME: ${{ github.repository }}
23+
24+
jobs:
25+
# Publish both prod and dev images on push to main.
26+
# prod -> :main, :sha-<short>
27+
# dev -> :main-dev, :sha-<short>-dev
28+
publish-main:
29+
name: Publish ${{ matrix.target }}
30+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
31+
runs-on: ubuntu-latest
32+
permissions:
33+
contents: read
34+
packages: write
35+
strategy:
36+
matrix:
37+
include:
38+
- target: prod
39+
suffix: ""
40+
- target: dev
41+
suffix: "-dev"
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v4
45+
46+
- name: Set up QEMU
47+
uses: docker/setup-qemu-action@v3
48+
49+
- name: Set up Docker Buildx
50+
uses: docker/setup-buildx-action@v3
51+
52+
- name: Log in to GHCR
53+
uses: docker/login-action@v3
54+
with:
55+
registry: ${{ env.REGISTRY }}
56+
username: ${{ github.actor }}
57+
password: ${{ secrets.GITHUB_TOKEN }}
58+
59+
- name: Extract metadata
60+
id: meta
61+
uses: docker/metadata-action@v5
62+
with:
63+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
64+
tags: |
65+
type=raw,value=main${{ matrix.suffix }}
66+
type=sha,suffix=${{ matrix.suffix }}
67+
68+
- name: Build and push
69+
uses: docker/build-push-action@v6
70+
with:
71+
context: .
72+
target: ${{ matrix.target }}
73+
platforms: linux/amd64,linux/arm64
74+
push: true
75+
tags: ${{ steps.meta.outputs.tags }}
76+
labels: ${{ steps.meta.outputs.labels }}
77+
cache-from: type=gha,scope=${{ matrix.target }}
78+
cache-to: type=gha,scope=${{ matrix.target }},mode=max
79+
80+
# PR build check (no push) - both targets, single platform for speed.
81+
build-check:
82+
name: Build Check (${{ matrix.target }})
83+
if: github.event_name == 'pull_request'
84+
runs-on: ubuntu-latest
85+
permissions:
86+
contents: read
87+
strategy:
88+
matrix:
89+
target: [dev, prod]
90+
steps:
91+
- name: Checkout
92+
uses: actions/checkout@v4
93+
94+
- name: Set up Docker Buildx
95+
uses: docker/setup-buildx-action@v3
96+
97+
- name: Build ${{ matrix.target }}
98+
uses: docker/build-push-action@v6
99+
with:
100+
context: .
101+
target: ${{ matrix.target }}
102+
platforms: linux/amd64
103+
push: false
104+
cache-from: type=gha,scope=${{ matrix.target }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Binaries Releaser
2+
3+
# On a published release (or when the Releaser workflow completes), goreleaser
4+
# builds the cross-platform binaries AND the multi-arch release container
5+
# (ghcr.io/fil-forge/ingot:vX.Y.Z) per .goreleaser.yaml, and attaches the
6+
# archives to the GitHub release.
7+
on:
8+
release:
9+
types: [ published ]
10+
workflow_dispatch:
11+
workflow_run:
12+
workflows: [Releaser]
13+
types: [completed]
14+
15+
permissions:
16+
contents: write
17+
packages: write
18+
19+
jobs:
20+
bin-releaser:
21+
name: Release Binaries
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 0
28+
- name: Set up Go
29+
uses: actions/setup-go@v5
30+
with:
31+
go-version: "1.25.x"
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v3
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v3
36+
- name: Log in to the Container registry
37+
uses: docker/login-action@v3
38+
with:
39+
registry: ghcr.io
40+
username: ${{ github.actor }}
41+
password: ${{ secrets.GITHUB_TOKEN }}
42+
- name: Release Binaries and Containers
43+
uses: goreleaser/goreleaser-action@v6
44+
with:
45+
distribution: goreleaser
46+
version: latest
47+
args: release --clean
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Release Checker
2+
3+
# Validates version.json bumps on PRs (semver, not already released).
4+
on:
5+
pull_request_target:
6+
paths: [ 'version.json' ]
7+
types: [ opened, synchronize, reopened, labeled, unlabeled ]
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
release-check:
20+
uses: ipdxco/unified-github-workflows/.github/workflows/release-check.yml@63392e900bbe802fb1a826ba763f6f543773dc36 # v1.0

.github/workflows/releaser.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Releaser
2+
3+
# When version.json changes on main, the unified releaser cuts the git tag
4+
# and GitHub release for that version. Binaries + containers are then built by
5+
# the Binaries Releaser workflow (release-binaries.yml) on completion.
6+
on:
7+
push:
8+
paths: [ 'version.json' ]
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: write
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.sha }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
releaser:
20+
uses: ipdxco/unified-github-workflows/.github/workflows/releaser.yml@63392e900bbe802fb1a826ba763f6f543773dc36 # v1.0

.github/workflows/tagpush.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Tag Push Checker
2+
3+
# Sanity-checks v* tags pushed directly (outside the Releaser flow).
4+
on:
5+
push:
6+
tags:
7+
- v*
8+
9+
permissions:
10+
contents: read
11+
issues: write
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
releaser:
19+
uses: ipdxco/unified-github-workflows/.github/workflows/tagpush.yml@63392e900bbe802fb1a826ba763f6f543773dc36 # v1.0

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
*.so
99
*.dylib
1010

11+
# The daemon binary from `make build` (leading slash: root only, not cmd/ingot/)
12+
/ingot
13+
1114
# Test binary, built with `go test -c`
1215
*.test
1316

0 commit comments

Comments
 (0)