Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: CI

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

defaults:
run:
shell: bash

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
# Both Go files are cgo wrappers over the vendored evmone/intx C++ sources.
CGO_ENABLED: "1"
# go.mod declares go 1.17 as the module minimum; build with a current toolchain.
GO_VERSION: "1.25"

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

- uses: actions/setup-go@v7
with:
go-version: ${{ env.GO_VERSION }}
# The module has no dependencies and no go.sum, so there is nothing
# for the dependency cache to key on.
cache: false

- uses: golangci/golangci-lint-action@v9
with:
version: v2.12.2

build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

- uses: actions/setup-go@v7
with:
go-version: ${{ env.GO_VERSION }}
cache: false

- name: Compiler versions
run: |
go version
${CXX:-c++} --version

- run: go build ./...

- run: go vet ./...

- run: go test ./...

actionlint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false

- name: actionlint
run: |
curl -sSfL \
"https://github.com/rhysd/actionlint/releases/download/v1.7.12/actionlint_1.7.12_linux_amd64.tar.gz" \
| tar -xz -C /usr/local/bin actionlint
actionlint
22 changes: 22 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: "2"

run:
# Every package here is cgo; without this the linter sees no Go code at all.
build-tags: []

linters:
default: standard
enable:
- misspell
- unconvert
- usestdlibvars
settings:
govet:
enable:
# The whole package is unsafe.Pointer conversions into C++.
- unsafeptr

formatters:
enable:
- gofmt
- goimports