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

Create tests.yml #586

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
29 changes: 29 additions & 0 deletions .github/workflows/audity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .github/workflows/libwasmvm_audit.yml
name: libwasmvm_audit

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
libwasmvm_audit:
runs-on: ubuntu-latest
container:
image: rust:1.83.0
steps:
- uses: actions/checkout@v4
- name: Install OpenSSL
run: |
sudo apt update
sudo apt install libssl-dev
- name: Show Rust version information
run: rustc --version && cargo --version && rustup --version
- name: Install cargo-audit
run: cargo install --debug cargo-audit --version 0.21.0
- name: Run cargo-audit
working-directory: libwasmvm
run: cargo audit
39 changes: 39 additions & 0 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# .github/workflows/clippy.yml
name: Clippy Checks

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
libwasmvm_clippy_msrv:
runs-on: ubuntu-latest
container:
image: rust:1.83.0
steps:
- uses: actions/checkout@v4
- name: Version information
run: rustc --version && cargo --version
- name: Add clippy component
run: rustup component add clippy
- name: Run clippy
working-directory: libwasmvm
run: cargo clippy --all-targets -- -D warnings

libwasmvm_clippy_stable:
runs-on: ubuntu-latest
container:
image: rust:1.83.0
steps:
- uses: actions/checkout@v4
- name: Version information
run: rustc --version && cargo --version
- name: Add clippy component
run: rustup component add clippy
- name: Run clippy
working-directory: libwasmvm
run: cargo clippy --all-targets -- -D warnings
51 changes: 51 additions & 0 deletions .github/workflows/libwasmvm-sanity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# .github/workflows/libwasmvm_sanity.yml
name: libwasmvm_sanity

on:
push:
branches:
- main
- 0.14-dev
- GoIter-creation
- release/*
pull_request:
branches:
- main

jobs:
libwasmvm_sanity:
runs-on: ubuntu-latest
container:
image: rust:1.83.0
steps:
- uses: actions/checkout@v4
- name: Show Rust version information
run: rustc --version && cargo --version && rustup --version
- name: Add Rust components
run: rustup component add rustfmt
- name: Ensure libwasmvm/bindings.h is up-to-date
working-directory: libwasmvm
run: |
cargo check
CHANGES_IN_REPO=$(git status --porcelain bindings.h)
if [[ -n "$CHANGES_IN_REPO" ]]; then
echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:"
git status && git --no-pager diff
exit 1
fi
- name: Ensure internal/api/bindings.h is up to date
run: diff libwasmvm/bindings.h internal/api/bindings.h
- name: Check Rust formatting
working-directory: libwasmvm
run: cargo fmt -- --check
- name: Run unit tests
working-directory: libwasmvm
run: cargo test
- name: Build docs
working-directory: libwasmvm
run: cargo doc --no-deps
- name: Test docs
working-directory: libwasmvm
run: |
sed -i '/^crate-type = \["cdylib"\]/d' Cargo.toml
cargo test --doc
15 changes: 15 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on: [push, pull_request]
name: Test
jobs:
test:
strategy:
matrix:
go-version: [1.23.x]
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- run: go test ./...
23 changes: 23 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# .github/workflows/windows.yml
name: Windows Tests

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
libwasmvm_sanity_windows:
runs-on: windows-latest
container:
image: rust:1.83.0
steps:
- uses: actions/checkout@v4
- name: Show Rust version information
run: rustc --version && cargo --version && rustup --version
- name: Run unit tests
working-directory: libwasmvm
run: cargo test
6 changes: 1 addition & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@ linters:
# https://golangci-lint.run/usage/linters/#enabled-by-default
enable:
- gofumpt
- goimports

linters-settings:
goimports:
local-prefixes: github.com/CosmWasm/wasmvm
- gci
5 changes: 2 additions & 3 deletions ibc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import (
"os"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/CosmWasm/wasmvm/v2/internal/api"
"github.com/CosmWasm/wasmvm/v2/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

const IBC_TEST_CONTRACT = "./testdata/ibc_reflect.wasm"
Expand Down
3 changes: 1 addition & 2 deletions internal/api/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import (
"os"
"testing"

"github.com/stretchr/testify/require"

"github.com/CosmWasm/wasmvm/v2/types"
"github.com/stretchr/testify/require"
)

func TestValidateAddressFailure(t *testing.T) {
Expand Down
5 changes: 2 additions & 3 deletions internal/api/iterator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import (
"sync"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/CosmWasm/wasmvm/v2/internal/api/testdb"
"github.com/CosmWasm/wasmvm/v2/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

type queueData struct {
Expand Down
3 changes: 1 addition & 2 deletions internal/api/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ import (
"strings"
"syscall"

"golang.org/x/sys/unix"

"github.com/CosmWasm/wasmvm/v2/types"
"golang.org/x/sys/unix"
)

// Value types
Expand Down
3 changes: 1 addition & 2 deletions internal/api/lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import (
"testing"
"time"

"github.com/CosmWasm/wasmvm/v2/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/CosmWasm/wasmvm/v2/types"
)

const (
Expand Down
5 changes: 2 additions & 3 deletions internal/api/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import (
"strings"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/CosmWasm/wasmvm/v2/internal/api/testdb"
"github.com/CosmWasm/wasmvm/v2/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

/** helper constructors **/
Expand Down
5 changes: 2 additions & 3 deletions lib_libwasmvm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import (
"os"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/CosmWasm/wasmvm/v2/internal/api"
"github.com/CosmWasm/wasmvm/v2/types"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions lib_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ package cosmwasm
import (
"testing"

"github.com/stretchr/testify/require"

"github.com/CosmWasm/wasmvm/v2/types"
"github.com/stretchr/testify/require"
)

func TestCreateChecksum(t *testing.T) {
Expand Down
Loading
Loading