Skip to content
Merged
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
63 changes: 57 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: 2

jobs:
# All checks on the codebase that can run in parallel to build_library
sanity:
docker:
# We don't use this Rust version but need an image with a Rust environment
Expand All @@ -25,11 +26,14 @@ jobs:
- run:
name: Run linter
command: cargo clippy -- -D warnings
- run:
name: Run unit tests
command: cargo test
- run:
name: Run shellcheck
command: find . -name "*.sh" -exec shellcheck {} +

build_libwasmvm:
build_library:
docker:
# We don't use this Rust version but need an image with a Rust environment
- image: circleci/rust:1.47.0-buster
Expand All @@ -41,9 +45,6 @@ jobs:
- run:
name: Show version information
command: rustc --version; cargo --version; rustup --version
- run:
name: Run tests
command: cargo test
- run:
name: Create release build of libwasmvm
command: make build-rust
Expand Down Expand Up @@ -115,15 +116,53 @@ jobs:
git commit --allow-empty -m '[skip ci] Built release libraries'
git push origin $CIRCLE_BRANCH

deploy_to_github_releases:
machine:
image: ubuntu-1604:202010-01
steps:
- checkout
- run:
name: Install ghr
command: |
go get github.com/tcnksm/ghr
ghr --version
- run:
name: Build static library for Alpine
command: make release-build-alpine
- run:
name: Debug build results
command: ls -l ./api
- run:
name: Collect artifacts
command: |
mkdir artifacts
cp ./api/libwasmvm_muslc.a artifacts
- run:
name: Create checksums
working_directory: artifacts
command: sha256sum * > checksums.txt && cat checksums.txt
- run:
name: Publish artifacts on GitHub
command: |
TAG="$CIRCLE_TAG"
TITLE="$TAG"
BODY="Build artifacts generated at this tag."
ghr -t "$GITHUB_TOKEN" \
-u "$CIRCLE_PROJECT_USERNAME" -r "$CIRCLE_PROJECT_REPONAME" \
-c "$CIRCLE_SHA1" \
-n "$TITLE" -b "$BODY" \
-delete \
"$TAG" ./artifacts/

workflows:
version: 2
build_and_test:
jobs:
- sanity
- build_libwasmvm
- build_library
- test:
requires:
- build_libwasmvm
- build_library
# This is long running, so only double-check on merge commits
# ensures that all code works on alpine linux
- test_alpine_build:
Expand All @@ -136,10 +175,22 @@ workflows:
- master
# Run only on master, not on tags (auto-build on merge PR)
- deploy_to_git:
requires:
- sanity
- test
filters:
tags:
ignore:
- /.*/
branches:
only:
- master
- deploy_to_github_releases:
requires:
- sanity
- test
filters:
tags:
only: /^v[0-9]+\.[0-9]+\.[0-9]+.*/
branches:
ignore: /.*/
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
lib*.a

# artifacts from compile tests
artifacts/
muslc.exe
tmp
a.out
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wasmvm"
version = "0.12.0-alpha1"
version = "0.12.0-alpha2"
authors = ["Ethan Frey <ethanfrey@users.noreply.github.com>"]
edition = "2018"
description = "Go bindings for cosmwasm contracts"
Expand Down