Skip to content

Backport EVM-only RPC methods from giga-1 (CON-427, CON-428, CON-429,… #11691

Backport EVM-only RPC methods from giga-1 (CON-427, CON-428, CON-429,…

Backport EVM-only RPC methods from giga-1 (CON-427, CON-428, CON-429,… #11691

name: Cross-Architecture Build Test
on:
pull_request:
merge_group:
push:
branches:
- main
- release/**
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
env:
LEDGER_ENABLED: false
jobs:
linux-amd64:
name: "Linux AMD64"
runs-on: ubuntu-latest
steps:
- name: Checkout code
# See: https://github.com/actions/checkout/releases/tag/v7.0.0
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: '1.27.1'
- name: Install system dependencies
run: |
bash .github/scripts/ci-drop-third-party-apt-sources.sh
sudo apt-get update
sudo apt-get install -y build-essential
- name: Verify Go installation
run: |
go version
echo "GOARCH: $(go env GOARCH)"
echo "GOOS: $(go env GOOS)"
- name: Download Go dependencies
run: go mod download
- name: Run make install
run: make install
- name: Verify install binary
run: seid version --long
- name: Run make build
run: make build
- name: Verify build binary
run: ./build/seid version --long
linux-arm64:
name: "Linux ARM64"
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout code
# See: https://github.com/actions/checkout/releases/tag/v7.0.0
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: '1.27.1'
- name: Install system dependencies
run: |
bash .github/scripts/ci-drop-third-party-apt-sources.sh
sudo apt-get update
sudo apt-get install -y build-essential
- name: Verify Go installation
run: |
go version
echo "GOARCH: $(go env GOARCH)"
echo "GOOS: $(go env GOOS)"
- name: Download Go dependencies
run: go mod download
- name: Run make install
run: make install
- name: Verify install binary
run: seid version --long
- name: Run make build
run: make build
- name: Verify build binary
run: ./build/seid version --long
# The link-directive tests are per-platform: the arm64 expectations only
# compile into the test binary on an arm64 host, so amd64 jobs cannot run them.
- name: Verify cgo link directives for this architecture
run: go test -count=1 -v -run 'TestLinkConstraints|TestLinkDirectivesResolve|TestArtifactsHaveNoOrphans' .
# Detect PRs that change the static-build inputs so they run the full static
# job below even when targeting main; otherwise a change to the static build
# only gets exercised once it reaches a release branch.
static-paths:
name: "Static build inputs changed?"
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
outputs:
changed: ${{ steps.diff.outputs.changed }}
steps:
- id: diff
env:
GH_TOKEN: ${{ github.token }}
run: |
PATTERN='^(scripts/(build-static|boot-smoke|check-libwasmvm-static|goreleaser-shim|check-goreleaser-hooks)\.sh|Makefile|third_party/alpine-gcc10-libgcc/|sei-wasmvm/internal/api/link_|link_(constraints|directives)_test\.go|\.goreleaser\.yaml|\.github/workflows/cross-arch-build\.yml)'
FILES=$(gh api "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" --paginate -q '.[].filename')
if echo "$FILES" | grep -qE "$PATTERN"; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi
echo "static-relevant files: $(echo "$FILES" | grep -cE "$PATTERN" || true)"
linux-amd64-static:
name: "Linux AMD64 (static)"
runs-on: ubuntu-latest
needs: [static-paths]
# The static seid is a release artefact: build it for release work (PRs into
# release/**, pushes to release/**, merge-queue entries targeting release/**)
# and for any PR that changes the static-build inputs themselves. The
# !cancelled() keeps this job eligible when static-paths is skipped (push and
# merge_group events).
if: >-
!cancelled() && (
startsWith(github.base_ref, 'release/') ||
startsWith(github.ref, 'refs/heads/release/') ||
startsWith(github.event.merge_group.base_ref, 'refs/heads/release/') ||
needs.static-paths.outputs.changed == 'true' )
steps:
- name: Checkout code
# See: https://github.com/actions/checkout/releases/tag/v7.0.0
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
# Build inside Alpine (musl-native): Ubuntu's musl-gcc can't fully static-link
# on 24.04 (glibc libgcc -> _dl_find_object, absent in musl). Alpine's
# gcc is GNU ld + musl, so it links cleanly. Same script the goreleaser release
# build runs (scripts/build-static.sh); goreleaser then packages it via the tool shim.
- name: Build statically (Alpine / musl)
run: bash scripts/build-static.sh amd64
# goreleaser is never run by CI, so its hooks are unexecuted strings until a tag is
# pushed. This catches an unrunnable hook in milliseconds instead.
- name: Verify goreleaser hooks are executable
run: bash scripts/check-goreleaser-hooks.sh
- name: Assert binary is statically linked
run: |
info=$(file ./build/seid-amd64)
echo "$info"
echo "$info" | grep -q "statically linked" \
|| { echo "ERROR: seid is not statically linked"; exit 1; }
- name: Assert no dynamic dependencies
run: |
# On a true static binary, ldd reports "not a dynamic executable".
ldd ./build/seid-amd64 2>&1 | grep -qE "not a dynamic|statically linked" \
|| { echo "ERROR: seid has dynamic dependencies:"; ldd ./build/seid-amd64; exit 1; }
- name: Smoke test
run: ./build/seid-amd64 version --long
# Repeated boots: the gcc>=12 unwind b-tree crash killed ~70% of boots at the
# genesis wasm store, so a single boot (let alone `seid version`, which never
# touches the wasm VM) can pass on luck. See scripts/boot-smoke.sh.
- name: Boot smoke (repeated)
run: bash scripts/boot-smoke.sh ./build/seid-amd64 8
- name: Upload artifact for inspection
uses: actions/upload-artifact@v5
with:
name: seid-linux-amd64-static
path: ./build/seid-amd64
retention-days: 14
linux-arm64-static:
name: "Linux ARM64 (static)"
runs-on: ubuntu-24.04-arm
needs: [static-paths]
# Same gating as the amd64 static job. The release hook also boots the arm64 binary
# through binfmt, but only this job boots it on arm64 hardware, which is what the
# gcc>=12 unwind b-tree needs to surface reliably.
if: >-
!cancelled() && (
startsWith(github.base_ref, 'release/') ||
startsWith(github.ref, 'refs/heads/release/') ||
startsWith(github.event.merge_group.base_ref, 'refs/heads/release/') ||
needs.static-paths.outputs.changed == 'true' )
timeout-minutes: 45
steps:
- name: Checkout code
# See: https://github.com/actions/checkout/releases/tag/v7.0.0
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
# Native arm64, so no binfmt or emulation is involved and the boots below run on
# real hardware.
- name: Build statically (Alpine / musl)
run: bash scripts/build-static.sh arm64
- name: Assert binary is statically linked
run: |
info=$(file ./build/seid-arm64)
echo "$info"
echo "$info" | grep -q "statically linked" \
|| { echo "ERROR: seid is not statically linked"; exit 1; }
echo "$info" | grep -q "aarch64" \
|| { echo "ERROR: seid is not an aarch64 binary"; exit 1; }
- name: Assert no dynamic dependencies
run: |
ldd ./build/seid-arm64 2>&1 | grep -qE "not a dynamic|statically linked" \
|| { echo "ERROR: seid has dynamic dependencies:"; ldd ./build/seid-arm64; exit 1; }
- name: Smoke test
run: ./build/seid-arm64 version --long
# The gcc>=12 unwind b-tree crash reproduces on arm64 too: an unpinned build
# SIGSEGVs on the first boot under RAYON_NUM_THREADS=1, which boot-smoke pins.
- name: Boot smoke (repeated)
run: bash scripts/boot-smoke.sh ./build/seid-arm64 8
- name: Upload artifact for inspection
uses: actions/upload-artifact@v5
with:
name: seid-linux-arm64-static
path: ./build/seid-arm64
retention-days: 14
macos-arm64:
name: "macOS ARM64"
runs-on: macos-latest
steps:
- name: Checkout code
# See: https://github.com/actions/checkout/releases/tag/v7.0.0
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
submodules: true
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version: '1.27.1'
- name: Install system dependencies
run: |
xcode-select --version || xcode-select --install
- name: Verify Go installation
run: |
go version
echo "GOARCH: $(go env GOARCH)"
echo "GOOS: $(go env GOOS)"
- name: Download Go dependencies
run: go mod download
- name: Run make install
run: make install
- name: Verify install binary
run: seid version --long
- name: Run make build
run: make build
- name: Verify build binary
run: ./build/seid version --long