From b6f3eb909345ddfe514be8f63637942ccfa597ea Mon Sep 17 00:00:00 2001 From: Arran Schlosberg <519948+ARR4N@users.noreply.github.com> Date: Tue, 10 Sep 2024 20:52:25 +0100 Subject: [PATCH] chore: basic CI (#9) * chore: Go CI runs on `libevm` branch * fix: stop using `reflect.TypeFor[T]()` * chore: rename job, remove flaky tests, and clear `GOOS`+`GOARCH` * fix: PR branch was `libem` * chore: rename workflow * chore: disable flaky `accounts/keystore` test --- .github/workflows/go.yml | 15 ++++++--------- params/config.libevm.go | 3 ++- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 0c673d15f1..62517d0699 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,15 +1,15 @@ -name: i386 linux tests +name: Go on: push: - branches: [ master ] + branches: [ libevm ] pull_request: - branches: [ master ] + branches: [ libevm ] workflow_dispatch: jobs: - build: - runs-on: self-hosted + go_test_short: + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Go @@ -17,7 +17,4 @@ jobs: with: go-version: 1.21.4 - name: Run tests - run: go test -short ./... - env: - GOOS: linux - GOARCH: 386 + run: go test -short $(go list ./... | grep -Pv 'go-ethereum/(accounts/keystore|eth/downloader|miner)$') diff --git a/params/config.libevm.go b/params/config.libevm.go index 37665be210..c4c45f4afe 100644 --- a/params/config.libevm.go +++ b/params/config.libevm.go @@ -108,7 +108,8 @@ func (*Extras[C, R]) getter() (g ExtraPayloadGetter[C, R]) { return } // mustBeStruct panics if `T` isn't a struct. func mustBeStruct[T any]() { - if k := reflect.TypeFor[T]().Kind(); k != reflect.Struct { + var x T + if k := reflect.TypeOf(x).Kind(); k != reflect.Struct { panic(notStructMessage[T]()) } }