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
This commit is contained in:
Arran Schlosberg 2024-09-10 20:52:25 +01:00 committed by GitHub
parent 5429fd87c8
commit b6f3eb9093
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 10 deletions

View file

@ -1,15 +1,15 @@
name: i386 linux tests name: Go
on: on:
push: push:
branches: [ master ] branches: [ libevm ]
pull_request: pull_request:
branches: [ master ] branches: [ libevm ]
workflow_dispatch: workflow_dispatch:
jobs: jobs:
build: go_test_short:
runs-on: self-hosted runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up Go - name: Set up Go
@ -17,7 +17,4 @@ jobs:
with: with:
go-version: 1.21.4 go-version: 1.21.4
- name: Run tests - name: Run tests
run: go test -short ./... run: go test -short $(go list ./... | grep -Pv 'go-ethereum/(accounts/keystore|eth/downloader|miner)$')
env:
GOOS: linux
GOARCH: 386

View file

@ -108,7 +108,8 @@ func (*Extras[C, R]) getter() (g ExtraPayloadGetter[C, R]) { return }
// mustBeStruct panics if `T` isn't a struct. // mustBeStruct panics if `T` isn't a struct.
func mustBeStruct[T any]() { 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]()) panic(notStructMessage[T]())
} }
} }