Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
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
24 changes: 0 additions & 24 deletions .github/actions/install-deps/action.yml

This file was deleted.

64 changes: 64 additions & 0 deletions .github/actions/setup-build-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: 'Setup Build Environment'
description: 'Setup Go, install deps, cache/build FFI - everything needed to build'

inputs:
go-version:
description: 'Go version to use'
required: true

runs:
using: 'composite'
steps:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}
cache: true
cache-dependency-path: go.sum

- name: Install system dependencies (Ubuntu only)
run: |
if command -v apt-get &> /dev/null; then
sudo apt-get update
sudo apt-get install -y curl ca-certificates gnupg ocl-icd-opencl-dev libhwloc-dev
fi
shell: bash

- name: Download Go modules
run: go mod download
shell: bash

# Cache FFI build based on submodule commit
- name: Generate FFI cache key
id: ffi-cache-key
run: |
FFI_COMMIT=$(git -C extern/filecoin-ffi rev-parse HEAD 2>/dev/null || echo "unknown")
echo "key=ffi-${{ runner.os }}-${{ inputs.go-version }}-${FFI_COMMIT}" >> $GITHUB_OUTPUT
shell: bash

- name: Cache FFI build
id: cache-ffi
uses: actions/cache@v4
with:
path: |
extern/filecoin-ffi/.install-filcrypto
extern/filecoin-ffi/filcrypto.h
extern/filecoin-ffi/libfilcrypto.a
extern/filecoin-ffi/filcrypto.pc
build/.filecoin-install
build/.blst-install
extern/supraseal/.install-blst
extern/supraseal/deps/blst
key: ${{ steps.ffi-cache-key.outputs.key }}

- name: Build FFI
if: steps.cache-ffi.outputs.cache-hit != 'true'
run: make deps
shell: bash

- name: Restore FFI marker files
if: steps.cache-ffi.outputs.cache-hit == 'true'
run: |
mkdir -p build
touch build/.filecoin-install build/.blst-install || true
shell: bash
16 changes: 0 additions & 16 deletions .github/actions/setup-go/action.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/images/build-env/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Build environment for Curio CI
# Contains: Go, system dependencies, and common tools
# Rebuild when: Go version changes, system deps change, go.mod/go.sum change

ARG GO_VERSION=1.24.7

FROM golang:${GO_VERSION}-bookworm

# Install system dependencies (same as install-deps action)
RUN apt-get update && apt-get install -y \
curl \
ca-certificates \
gnupg \
ocl-icd-opencl-dev \
libhwloc-dev \
git \
&& rm -rf /var/lib/apt/lists/*

# Install Docker CLI (for test-itest to communicate with host Docker daemon)
RUN install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc && \
chmod a+r /etc/apt/keyrings/docker.asc && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian bookworm stable" > /etc/apt/sources.list.d/docker.list && \
apt-get update && \
apt-get install -y docker-ce-cli && \
rm -rf /var/lib/apt/lists/*

# Set up workspace
WORKDIR /workspace

# Copy go.mod and go.sum to pre-download modules
COPY go.mod go.sum ./

# Pre-download Go modules (will be cached in /go/pkg/mod)
RUN go mod download

# Install common dev/CI tools (from tools/tools.go)
RUN go install golang.org/x/tools/cmd/goimports@latest && \
go install github.com/hannahhoward/cbor-gen-for@latest && \
go install github.com/swaggo/swag/cmd/swag@latest

51 changes: 51 additions & 0 deletions .github/workflows/build-env-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build CI Environment Image

on:
push:
branches: [main]
paths:
- '.github/images/build-env/**'
- '.github/workflows/build-env-image.yml'
- 'go.mod'
- 'go.sum'
workflow_dispatch: # Allow manual trigger

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/build-env

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- name: Log in to Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest
type=sha,prefix=

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: .github/images/build-env/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Loading
Loading