129 lines
3.3 KiB
YAML
129 lines
3.3 KiB
YAML
version: 2.1
|
|
|
|
commands:
|
|
test:
|
|
parameters:
|
|
arch:
|
|
default: "amd64"
|
|
description: The target architecture.
|
|
type: enum
|
|
enum: ["amd64", "386"]
|
|
steps:
|
|
- run:
|
|
name: "Test (<<parameters.arch>>)"
|
|
command: |
|
|
export GOARCH=<<parameters.arch>>
|
|
go version
|
|
go env
|
|
go test -v -coverprofile=coverage-<<parameters.arch>>.txt -covermode=count
|
|
|
|
jobs:
|
|
|
|
go123:
|
|
docker:
|
|
- image: cimg/go:1.23
|
|
steps:
|
|
- run:
|
|
name: "Install tools"
|
|
command: |
|
|
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.61.0
|
|
- checkout
|
|
- run:
|
|
name: "Lint"
|
|
command: golangci-lint run
|
|
- test:
|
|
arch: "amd64"
|
|
- test:
|
|
arch: "386"
|
|
- run:
|
|
name: "Codecov upload"
|
|
command: bash <(curl -s https://codecov.io/bash)
|
|
- restore_cache:
|
|
keys:
|
|
- corpus-v3
|
|
- run:
|
|
name: "Fuzzing"
|
|
command: |
|
|
GOCACHE=/home/circleci/project/corpus-v3 go test . -run - -fuzz FuzzBinaryOperations -fuzztime 20s
|
|
GOCACHE=/home/circleci/project/corpus-v3 go test . -run - -fuzz FuzzCompareOperations -fuzztime 20s
|
|
GOCACHE=/home/circleci/project/corpus-v3 go test . -run - -fuzz FuzzTernaryOperations -fuzztime 20s
|
|
GOCACHE=/home/circleci/project/corpus-v3 go test . -run - -fuzz FuzzBase10StringCompare -fuzztime 10s
|
|
GOCACHE=/home/circleci/project/corpus-v3 go test . -run - -fuzz FuzzDecimal -fuzztime 10s
|
|
GOCACHE=/home/circleci/project/corpus-v3 go test . -run - -fuzz FuzzFloat64 -fuzztime 10s
|
|
GOCACHE=/home/circleci/project/corpus-v3 go test . -run - -fuzz FuzzLog10 -fuzztime 10s
|
|
GOCACHE=/home/circleci/project/corpus-v3 go test . -run - -fuzz FuzzSetString -fuzztime 10s
|
|
- save_cache:
|
|
key: corpus-v3-{{ epoch }}
|
|
paths:
|
|
- corpus-v3
|
|
- run:
|
|
name: "Benchmark"
|
|
command: go test -run=- -bench=. -benchmem
|
|
- run:
|
|
name: "Build tests for PPC64"
|
|
command: |
|
|
GOARCH=ppc64 go test -c
|
|
mv uint256.test uint256.test.ppc64
|
|
- persist_to_workspace:
|
|
root: .
|
|
paths:
|
|
- uint256.test.*
|
|
|
|
bigendian:
|
|
docker:
|
|
- image: cimg/base:current
|
|
steps:
|
|
- run:
|
|
name: "Install QEMU"
|
|
command: sudo apt-get -q update && sudo apt-get -qy install qemu-user-static --no-install-recommends
|
|
- attach_workspace:
|
|
at: .
|
|
- run:
|
|
name: "Test (PPC64 emulation)"
|
|
command: qemu-ppc64-static uint256.test.ppc64 -test.v
|
|
|
|
go122:
|
|
docker:
|
|
- image: cimg/go:1.22
|
|
steps:
|
|
- checkout
|
|
- test
|
|
|
|
go121:
|
|
docker:
|
|
- image: cimg/go:1.21
|
|
steps:
|
|
- checkout
|
|
- test
|
|
|
|
go120:
|
|
docker:
|
|
- image: cimg/go:1.20
|
|
steps:
|
|
- checkout
|
|
- test
|
|
|
|
go119:
|
|
docker:
|
|
- image: cimg/go:1.19
|
|
steps:
|
|
- checkout
|
|
- test
|
|
|
|
|
|
|
|
workflows:
|
|
version: 2
|
|
uint256:
|
|
jobs:
|
|
- go119
|
|
- go120
|
|
- go121
|
|
- go122
|
|
- go123:
|
|
requires:
|
|
- go122
|
|
- bigendian:
|
|
requires:
|
|
- go123
|