Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci starlark #1171

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
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
6 changes: 6 additions & 0 deletions .drone.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
load("scripts/drone/pipelines/test_and_build.star", "pipeline_test_and_build")

def main(ctx):
return [
pipeline_test_and_build(ctx)
]
28 changes: 28 additions & 0 deletions .drone.star.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
kind: pipeline
name: test_and_build
steps:
- commands:
- git fetch --tags
image: alpine/git
name: fetch
- commands:
- ./scripts/go-test.sh
environment:
GOPROXY: http://goproxy
image: publicawesome/golang:1.22.7-devtooling
name: test
- commands:
- apk add --no-cache ca-certificates build-base git
- wget https://github.com/CosmWasm/wasmvm/releases/download/v2.2.1/libwasmvm_muslc.x86_64.a
-O /lib/libwasmvm_muslc.x86_64.a
- echo 'b3bd755efac0ff39c01b59b8110f961c48aa3eb93588071d7a628270cc1f2326 /lib/libwasmvm_muslc.x86_64.a'
| sha256sum -c
- LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build
- echo 'Ensuring binary is statically linked ...' && (file $PWD/bin/starsd | grep
'statically linked')
environment:
GOPROXY: http://goproxy
image: golang:1.22.7-alpine3.19
name: build
type: docker
6 changes: 3 additions & 3 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ steps:
path: /go
commands:
- apk add --no-cache ca-certificates build-base git
- wget https://github.com/CosmWasm/wasmvm/releases/download/v2.1.4/libwasmvm_muslc.x86_64.a -O /lib/libwasmvm_muslc.x86_64.a
- echo "a4a3d09b36fabb65b119d5ba23442c23694401fcbee4451fe6b7e22e325a4bac /lib/libwasmvm_muslc.x86_64.a" | sha256sum -c
- wget https://github.com/CosmWasm/wasmvm/releases/download/v2.2.1/libwasmvm_muslc.x86_64.a -O /lib/libwasmvm_muslc.x86_64.a
- echo "b3bd755efac0ff39c01b59b8110f961c48aa3eb93588071d7a628270cc1f2326 /lib/libwasmvm_muslc.x86_64.a" | sha256sum -c
- LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build
- echo "Ensuring binary is statically linked ..." && (file $PWD/bin/starsd | grep "statically linked")
environment:
Expand Down Expand Up @@ -424,6 +424,6 @@ volumes:

---
kind: signature
hmac: 96ed0e338ac7808aa42bdaae8e19f2fc75693763951efa5f8d9c9cca3afb3d9e
hmac: 3cd46999a6c2073a766eb4b250389aec4f13169adac843f5c6b8927207cbb4d1

...
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ COPY . /code/

# See https://github.com/CosmWasm/wasmvm/releases
# Download the correct version of libwasmvm for the given platform and verify checksum
ADD https://github.com/CosmWasm/wasmvm/releases/download/v2.1.4/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v2.1.4/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
RUN echo "a4a3d09b36fabb65b119d5ba23442c23694401fcbee4451fe6b7e22e325a4bac /lib/libwasmvm_muslc.x86_64.a" | sha256sum -c
RUN echo "faea4e15390e046d2ca8441c21a88dba56f9a0363f92c5d94015df0ac6da1f2d /lib/libwasmvm_muslc.aarch64.a" | sha256sum -c
ADD https://github.com/CosmWasm/wasmvm/releases/download/v2.2.1/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a
ADD https://github.com/CosmWasm/wasmvm/releases/download/v2.2.1/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a
RUN echo "b3bd755efac0ff39c01b59b8110f961c48aa3eb93588071d7a628270cc1f2326 /lib/libwasmvm_muslc.x86_64.a" | sha256sum -c
RUN echo "ba6cb5db6b14a265c8556326c045880908db9b1d2ffb5d4aa9f09ac09b24cecc /lib/libwasmvm_muslc.aarch64.a" | sha256sum -c

# force it to use static lib (from above) not standard libgo_cosmwasm.so file
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,7 @@ proto-format:

proto-lint:
@$(protoImage) buf lint --error-format=json


drone-generate:
drone starlark --format --target .drone.star.yml
2 changes: 1 addition & 1 deletion cmd/starsd/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/spf13/cobra"
)

var LibwasmVersion = "2.1.4"
var LibwasmVersion = "2.2.1"

func CheckLibwasmVersion(_ *cobra.Command, _ []string) error {
version, err := wasmvmapi.LibwasmvmVersion()
Expand Down
2 changes: 1 addition & 1 deletion e2e/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEV
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/Shopify/toxiproxy v2.2.1+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA=
github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8=
github.com/StirlingMarketingGroup/go-namecase v1.0.0 h1:2CzaNtCzc4iNHirR+5ru9OzGg8rQp860gqLBFqRI02Y=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ toolchain go1.22.8

require (
github.com/CosmWasm/wasmd v0.53.2
github.com/CosmWasm/wasmvm/v2 v2.1.4
github.com/CosmWasm/wasmvm/v2 v2.2.1
github.com/cometbft/cometbft v0.38.15
github.com/cosmos/cosmos-proto v1.0.0-beta.5
github.com/cosmos/cosmos-sdk v0.50.11
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,8 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/CosmWasm/wasmd v0.53.2 h1:c3MQjeQq+r+Zj2rPeW+c9kJmTevuNnZOIkiiCP/3bg4=
github.com/CosmWasm/wasmd v0.53.2/go.mod h1:gP10E56tuToU5rsZR7vZLBL5ssW2mie6KN/WrQLG7/I=
github.com/CosmWasm/wasmvm/v2 v2.1.4 h1:7EUVQjBxXHkVjL2AqqXD7hMEe0dmoNn2li9E4PWRAnA=
github.com/CosmWasm/wasmvm/v2 v2.1.4/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg=
github.com/CosmWasm/wasmvm/v2 v2.2.1 h1:cmOnM+TDfUl2VRugeo1eJBw4U/Lw0WLviuQHKSo9DVQ=
github.com/CosmWasm/wasmvm/v2 v2.2.1/go.mod h1:bMhLQL4Yp9CzJi9A83aR7VO9wockOsSlZbT4ztOl6bg=
github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ=
Expand Down
54 changes: 54 additions & 0 deletions scripts/drone/pipelines/test_and_build.star
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@

go_dev_image = "publicawesome/golang:1.22.7-devtooling"
go_image = "golang:1.22.7-alpine3.19"


def pipeline_test_and_build(ctx):
return {
"kind": "pipeline",
"type": "docker",
"name": "test_and_build",
"steps": [
step_fetch(ctx),
step_test(ctx),
step_build(ctx),
]

}

# Fetch the latest tags from the repository
def step_fetch(ctx):
return {
"name": "fetch",
"image": "alpine/git",
"commands": [
"git fetch --tags"
]
}
def step_test(ctx):
return {
"name": "test",
"image": go_dev_image,
"commands": [
"./scripts/go-test.sh"
],
"environment": {
"GOPROXY": "http://goproxy"
}
}

def step_build(ctx):
return {
"name": "build",
"image": go_image,
"commands": [
"apk add --no-cache ca-certificates build-base git",
"wget https://github.com/CosmWasm/wasmvm/releases/download/v2.2.1/libwasmvm_muslc.x86_64.a -O /lib/libwasmvm_muslc.x86_64.a",
"echo 'b3bd755efac0ff39c01b59b8110f961c48aa3eb93588071d7a628270cc1f2326 /lib/libwasmvm_muslc.x86_64.a' | sha256sum -c",
"LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build",
"echo 'Ensuring binary is statically linked ...' && (file $PWD/bin/starsd | grep 'statically linked')"
],
"environment": {
"GOPROXY": "http://goproxy"
}
}
Loading