mirror of
https://github.com/luxfi/indexer.git
synced 2026-09-24 00:25:37 +00:00
ci: hanzo runner labels everywhere, drop duplicate ci.yml
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
self-hosted-runner:
|
||||
labels:
|
||||
- hanzo-build-linux-amd64
|
||||
- hanzo-build-linux-arm64
|
||||
- hanzo-deploy-linux-amd64
|
||||
@@ -15,7 +15,7 @@ env:
|
||||
REGISTRY: ghcr.io
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: hanzo-build-linux-amd64
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
env:
|
||||
CGO_ENABLED: 1
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: hanzo-build-linux-amd64
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-go@v5
|
||||
|
||||
@@ -1,131 +0,0 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- v*
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
env:
|
||||
GO_VERSION: 1.25.5
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
test:
|
||||
name: Test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: true
|
||||
- name: Download dependencies
|
||||
run: go mod download
|
||||
- name: Run tests
|
||||
run: go test -v -race -coverprofile=coverage.out ./...
|
||||
- name: Upload coverage
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
files: ./coverage.out
|
||||
fail_ci_if_error: false
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
lint:
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: true
|
||||
- name: Run go vet
|
||||
run: go vet ./...
|
||||
- name: Check formatting
|
||||
run: |
|
||||
if [ -n "$(gofmt -l .)" ]; then
|
||||
echo "Code is not formatted. Run 'go fmt ./...'"
|
||||
gofmt -d .
|
||||
exit 1
|
||||
fi
|
||||
- name: Install golangci-lint
|
||||
run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
|
||||
- name: Run golangci-lint
|
||||
run: golangci-lint run --timeout=10m || true
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- test
|
||||
- lint
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- linux
|
||||
- darwin
|
||||
- windows
|
||||
arch:
|
||||
- amd64
|
||||
- arm64
|
||||
exclude:
|
||||
- os: windows
|
||||
arch: arm64
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
cache: true
|
||||
- name: Build
|
||||
env:
|
||||
GOOS: ${{ matrix.os }}
|
||||
GOARCH: ${{ matrix.arch }}
|
||||
CGO_ENABLED: 0
|
||||
run: |
|
||||
EXT=""
|
||||
if [ "${{ matrix.os }}" = "windows" ]; then
|
||||
EXT=".exe"
|
||||
fi
|
||||
go build -ldflags="-s -w -X main.version=${{ github.ref_name }}" \
|
||||
-o indexer-${{ matrix.os }}-${{ matrix.arch }}${EXT} ./cmd/indexer
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: indexer-${{ matrix.os }}-${{ matrix.arch }}
|
||||
path: indexer-${{ matrix.os }}-${{ matrix.arch }}*
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
- name: Prepare release files
|
||||
run: |
|
||||
mkdir -p release
|
||||
for dir in indexer-*; do
|
||||
if [ -d "$dir" ]; then
|
||||
for file in "$dir"/*; do
|
||||
cp "$file" release/
|
||||
done
|
||||
fi
|
||||
done
|
||||
ls -la release/
|
||||
- name: Create Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
files: release/*
|
||||
generate_release_notes: true
|
||||
draft: false
|
||||
prerelease: false
|
||||
@@ -8,7 +8,7 @@ permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
# Multi-arch (amd64 + arm64) on native lux ARC runners.
|
||||
# Multi-arch (amd64 + arm64) on native hanzo ARC runners.
|
||||
# No QEMU emulation. No GitHub-hosted fallback.
|
||||
# Semver-only tags (v*); see hanzoai/.github docker-build.yml.
|
||||
jobs:
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
with:
|
||||
image: ghcr.io/luxfi/indexer
|
||||
platforms: linux/amd64,linux/arm64
|
||||
runner-amd64: lux-build-linux-amd64
|
||||
runner-arm64: lux-build-linux-arm64
|
||||
runner-deploy: lux-build-linux-amd64
|
||||
runner-amd64: hanzo-build-linux-amd64
|
||||
runner-arm64: hanzo-build-linux-arm64
|
||||
runner-deploy: hanzo-deploy-linux-amd64
|
||||
secrets: inherit
|
||||
|
||||
@@ -19,7 +19,7 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: hanzo-build-linux-amd64
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: hanzo-build-linux-amd64
|
||||
needs: build
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
|
||||
Reference in New Issue
Block a user