Skip to content

Commit

Permalink
ci: cleanup into a single per-pr.yml gha (#295)
Browse files Browse the repository at this point in the history
* ci: cleanup into a single per-pr.yml gha

* chore: fix golangci.yml issues

* ci: rename gchr -> push-ghcr.yml

* ci: rename per-pr workflow to CI (readme badge looks better)

* docs: update README with new ci badges
  • Loading branch information
samlaf authored Feb 18, 2025
1 parent daf39e2 commit d7b1642
Show file tree
Hide file tree
Showing 10 changed files with 134 additions and 212 deletions.
65 changes: 0 additions & 65 deletions .github/workflows/build.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/fuzz-tests.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/holesky-test.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/lint.yml

This file was deleted.

105 changes: 105 additions & 0 deletions .github/workflows/per-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: CI # this name appears in the badge on the README

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

env:
GO_VERSION: '1.22'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION}}
# TODO: fix the local/ci drift... locally we use `make lint`.
# We should probably use mise to install golangci-lint and other dependencies,
# and then we could run make commands in CI.
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61
args: --timeout 3m

# This checks that the flags in .env.holesky.example are valid and allow the proxy to start.
flags:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION}}
- name: Run flag test
run: ${{ github.workspace }}/scripts/test-proxy-startup-with-env-vars.sh

test:
outputs:
COVERAGE: ${{ steps.unit.outputs.coverage }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- run: go mod download

# These tests are all pretty fast (<15s each), so we run them sequentially.
# If ever they become slow we could parallelize them by using a matrix strategy.
- run: make test-unit
- run: make test-e2e-local
- run: make test-e2e-holesky
env:
SIGNER_PRIVATE_KEY: ${{ secrets.SIGNER_PRIVATE_KEY }}
ETHEREUM_RPC: ${{ secrets.ETHEREUM_RPC }}

fuzz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- run: go mod download
- run: make test-e2e-fuzz

build-binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- run: make eigenda-proxy

build-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/build-push-action@v5
with:
push: false
context: .
tags: eigenda-proxy
# We also test that the docker container starts up correctly.
- name: Run container as background process
shell: bash
run: |
docker run -d \
-p 6666:6666 \
-e EIGENDA_PROXY_ADDR=0.0.0.0 \
-e EIGENDA_PROXY_PORT=6666 \
-e EIGENDA_PROXY_MEMSTORE_ENABLED=true \
eigenda-proxy
- name: Wait for rpc to come up
shell: bash
run: |
${{ github.workspace }}/scripts/wait-for.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and push container
name: Push Release Image to ghcr # This name is displayed in the badge

on:
push:
Expand Down
35 changes: 0 additions & 35 deletions .github/workflows/unit-tests.yml

This file was deleted.

6 changes: 6 additions & 0 deletions .yamlfmt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# For github action yaml file formatting.
# Useful when used with vscode yamlfmt extension.
# TODO: Currently not enforced by CI.
formatter:
type: basic
retain_line_breaks_single: true
21 changes: 9 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ LDFLAGSSTRING +=-X main.Date=$(BUILD_TIME)
LDFLAGSSTRING +=-X main.Version=$(GIT_TAG)
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"

E2EFUZZTEST = FUZZ=true go test ./e2e -fuzz -v -fuzztime=5m

.PHONY: eigenda-proxy
eigenda-proxy:
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/eigenda-proxy ./cmd/server
Expand All @@ -31,22 +29,21 @@ disperse-test-blob:
clean:
rm bin/eigenda-proxy

# Unit tests
test:
go test ./... -parallel 4
test-unit:
go test ./... -parallel 4

# E2E tests, leveraging op-e2e
e2e-test:
# Local E2E tests, leveraging op-e2e framework. Also tests the standard client against the proxy.
test-e2e-local:
INTEGRATION=true go test -timeout 1m ./e2e -parallel 4

# E2E test which fuzzes the proxy client server integration and op client keccak256 with malformed inputs
e2e-fuzz-test:
$(E2EFUZZTEST)

# E2E tests against holesky testnet
holesky-test:
test-e2e-holesky:
TESTNET=true go test -timeout 50m ./e2e -parallel 4

# E2E test which fuzzes the proxy client server integration and op client keccak256 with malformed inputs
test-e2e-fuzz:
FUZZ=true go test ./e2e -fuzz -v -fuzztime=5m

.PHONY: lint
lint:
@if ! test -f &> /dev/null; \
Expand Down
Loading

0 comments on commit d7b1642

Please sign in to comment.