Skip to content

ci: cleanup into a single per-pr.yml gha #2

ci: cleanup into a single per-pr.yml gha

ci: cleanup into a single per-pr.yml gha #2

Workflow file for this run

name: per-pr
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