chore(deps): bump github.com/go-viper/mapstructure/v2 in /tests/syste… #41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI checks | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
pull_request: | |
jobs: | |
setup-dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Restore Go modules cache | |
uses: actions/cache@v4 | |
with: | |
path: /go/pkg/mod | |
key: go-mod-${{ hashFiles('**/go.sum') }} | |
- name: Cache go modules | |
run: make go-mod-cache | |
- name: Build | |
run: make build | |
- name: Git garbage collection | |
run: git gc | |
- name: Save source code cache | |
uses: actions/cache@v4 | |
with: | |
path: .git | |
key: go-src-${{ github.sha }} | |
tidy-go: | |
runs-on: ubuntu-latest | |
needs: setup-dependencies | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Check go mod tidy | |
run: | | |
go mod tidy | |
git diff --exit-code | |
lint: | |
runs-on: ubuntu-latest | |
needs: setup-dependencies | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Run golangci-lint | |
uses: golangci/golangci-lint-action@v8 | |
with: | |
version: v2.1.6 | |
args: --tests=false --timeout=5m0s | |
test-cover: | |
runs-on: ubuntu-latest | |
needs: setup-dependencies | |
strategy: | |
matrix: | |
shard: [1, 2, 3, 4] | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Restore Go modules cache | |
uses: actions/cache@v4 | |
with: | |
path: /go/pkg/mod | |
key: go-mod-${{ hashFiles('**/go.sum') }} | |
- name: Run tests with coverage | |
run: | | |
mkdir -p profiles logs | |
export GORACE=halt_on_error=1 | |
export VERSION=$(git describe --tags --long | sed 's/v\(.*\)/\1/') | |
export GO111MODULE=on | |
SHARD_INDEX=$(( ${{ matrix.shard }} - 1 )) | |
go list ./... | grep -v '/simulation' | awk "NR % 4 == $SHARD_INDEX" | while read pkg; do | |
id=$(echo "$pkg" | sed 's|[/.]|_|g') | |
go test -mod=readonly -timeout 8m -race -coverprofile=profiles/$id.out -covermode=atomic -tags='ledger test_ledger_mock' "$pkg" | tee logs/$id.log | |
done | |
- name: Upload coverage and logs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-${{ matrix.shard }} | |
path: | | |
profiles/ | |
logs/ | |
upload-coverage: | |
runs-on: ubuntu-latest | |
needs: test-cover | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Download coverage artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Concatenate coverage files | |
run: | | |
echo "mode: atomic" > coverage.txt | |
find artifacts -name '*.out' | xargs -I{} tail -n +2 {} >> coverage.txt | |
- name: Upload to Codecov | |
run: bash <(curl -s https://codecov.io/bash) -f coverage.txt | |
test-system: | |
runs-on: ubuntu-latest | |
needs: test-cover | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Restore Go modules cache | |
uses: actions/cache@v4 | |
with: | |
path: /go/pkg/mod | |
key: go-mod-${{ hashFiles('**/go.sum') }} | |
- name: Add GOBIN to PATH | |
run: echo "$HOME/go/bin" >> $GITHUB_PATH | |
- name: Run system tests | |
run: make test-system | |
- name: Save artifacts on failure | |
if: failure() | |
run: | | |
mkdir -p /tmp/test-system-artifacts | |
mv tests/system/testnet /tmp/test-system-artifacts || true | |
- name: Upload test system artifacts | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-system-artifacts | |
path: /tmp/test-system-artifacts | |
benchmark: | |
runs-on: ubuntu-latest | |
needs: test-cover | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Restore Go modules cache | |
uses: actions/cache@v4 | |
with: | |
path: /go/pkg/mod | |
key: go-mod-${{ hashFiles('**/go.sum') }} | |
- name: Benchmarks for gas calculations | |
run: | | |
cd ./x/wasm/keeper | |
go test -bench . | |
- name: Benchmarks to compare with native modules | |
run: | | |
cd ./benchmarks | |
go test -bench . | |
simulations: | |
runs-on: ubuntu-latest | |
needs: setup-dependencies | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Run simulations | |
run: make test-sim-deterministic test-sim-multi-seed-short test-sim-import-export | |
docker-image: | |
runs-on: ubuntu-latest | |
needs: setup-dependencies | |
env: | |
IMAGE_NAME: cosmwasm/wasmd | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up Docker | |
uses: docker/setup-buildx-action@v3 | |
- name: Build Docker image | |
run: | | |
SHA=${{ github.sha }} | |
docker build --pull -t $IMAGE_NAME:$SHA . | |
- name: Check wasmvm version | |
run: | | |
SHA=${{ github.sha }} | |
IN_DOCKER=$(docker run --rm $IMAGE_NAME:$SHA /usr/bin/wasmd query wasm libwasmvm-version) | |
echo "Runtime libwasmvm-version in docker: $IN_DOCKER" | |
IN_GOMOD=$(go list -m github.com/CosmWasm/wasmvm/v3 | cut -d" " -f2 | cut -d"v" -f2) | |
echo "wasmvm version in go.mod: $IN_GOMOD" | |
if [[ "$IN_DOCKER" != "$IN_GOMOD" ]]; then | |
echo "Mismatch of wasmvm versions detected" | |
exit 1 | |
fi | |
- name: Login to DockerHub | |
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') | |
env: | |
DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKER_PASS: ${{ secrets.DOCKERHUB_TOKEN }} | |
run: | | |
echo $DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin | |
- name: Push Docker image | |
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') | |
run: | | |
SHA=${{ github.sha }} | |
docker push $IMAGE_NAME:$SHA | |
if [ "${{ github.ref_name }}" = "main" ]; then | |
docker tag $IMAGE_NAME:$SHA $IMAGE_NAME:latest | |
docker push $IMAGE_NAME:latest | |
fi | |
docker logout |