Skip to content

Commit 3d3bb09

Browse files
committed
MEME V1.0.0
0 parents  commit 3d3bb09

1,752 files changed

Lines changed: 505427 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
version: 2.1
2+
3+
executors:
4+
golang:
5+
docker:
6+
- image: circleci/golang:1.17
7+
working_directory: /go/src/github.com/MeMeCosmos/meme
8+
9+
commands:
10+
make:
11+
parameters:
12+
description:
13+
type: string
14+
target:
15+
type: string
16+
steps:
17+
- attach_workspace:
18+
at: /tmp/bin
19+
- restore_cache:
20+
name: "Restore source code cache"
21+
keys:
22+
- go-src-v1-{{ .Revision }}
23+
- checkout
24+
- restore_cache:
25+
name: "Restore go modules cache"
26+
keys:
27+
- go-mod-v1-{{ checksum "go.sum" }}
28+
- run:
29+
name: << parameters.description >>
30+
command: |
31+
export BINDIR=/tmp/bin
32+
make << parameters.target >>
33+
34+
jobs:
35+
setup-dependencies:
36+
executor: golang
37+
steps:
38+
- checkout
39+
- restore_cache:
40+
name: "Restore go modules cache"
41+
keys:
42+
- go-mod-v1-{{ checksum "go.sum" }}
43+
- run:
44+
name: Cache go modules
45+
command: make go-mod-cache
46+
- run:
47+
name: Build
48+
command: make build
49+
- run:
50+
name: "Git garbage collection"
51+
command: git gc
52+
- save_cache:
53+
name: "Save go modules cache"
54+
key: go-mod-v1-{{ checksum "go.sum" }}
55+
paths:
56+
- "/go/pkg/mod"
57+
- save_cache:
58+
name: "Save source code cache"
59+
key: go-src-v1-{{ .Revision }}
60+
paths:
61+
- ".git"
62+
63+
lint:
64+
docker:
65+
- image: golangci/golangci-lint:v1.43.0
66+
steps:
67+
- checkout
68+
- run:
69+
name: Lint
70+
command: |
71+
golangci-lint run --version
72+
golangci-lint run --tests=false --timeout=5m0s
73+
74+
test-cover:
75+
executor: golang
76+
parallelism: 4
77+
steps:
78+
- checkout
79+
- restore_cache:
80+
keys:
81+
- go-mod-v1-{{ checksum "go.sum" }}
82+
- run:
83+
name: Run tests with coverage
84+
command: |
85+
export GORACE=halt_on_error=1
86+
export VERSION="$(git describe --tags --long | sed 's/v\(.*\)/\1/')"
87+
export GO111MODULE=on
88+
mkdir -p /tmp/logs /tmp/workspace/profiles
89+
for pkg in $(go list ./... | grep -v '/simulation' | circleci tests split); do
90+
id=$(echo "$pkg" | sed 's|[/.]|_|g')
91+
go test -mod=readonly -timeout 8m -race -coverprofile=/tmp/workspace/profiles/$id.out -covermode=atomic -tags='ledger test_ledger_mock' "$pkg" | tee "/tmp/logs/$id-$RANDOM.log"
92+
done
93+
- persist_to_workspace:
94+
root: /tmp/workspace
95+
paths:
96+
- "profiles/*"
97+
- store_artifacts:
98+
path: /tmp/logs
99+
100+
benchmark:
101+
executor: golang
102+
parallelism: 1
103+
steps:
104+
- checkout
105+
- restore_cache:
106+
keys:
107+
- go-mod-v1-{{ checksum "go.sum" }}
108+
- run:
109+
name: Benchmarks for gas calculations
110+
command: |
111+
cd ./x/wasm/keeper
112+
go test -bench .
113+
- run:
114+
name: Benchmarks to compare with native modules
115+
command: |
116+
cd ./benchmarks
117+
go test -bench .
118+
119+
upload-coverage:
120+
executor: golang
121+
steps:
122+
- attach_workspace:
123+
at: /tmp/workspace
124+
- checkout
125+
- run:
126+
name: gather
127+
command: |
128+
set -ex
129+
130+
echo "--> Concatenating profiles:"
131+
ls /tmp/workspace/profiles/
132+
echo "mode: atomic" > coverage.txt
133+
for prof in $(ls /tmp/workspace/profiles/); do
134+
tail -n +2 /tmp/workspace/profiles/"$prof" >> coverage.txt
135+
done
136+
- run:
137+
name: upload
138+
command: bash <(curl -s https://codecov.io/bash) -f coverage.txt
139+
140+
docker-image:
141+
executor: golang
142+
steps:
143+
- attach_workspace:
144+
at: /tmp/workspace
145+
- checkout
146+
- setup_remote_docker:
147+
# >= v20.10 https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.14.0#faccessat2
148+
version: 20.10.11
149+
- run:
150+
name: Build Docker artifact
151+
command: docker build --pull -t "cosmwasm/wasmd:${CIRCLE_SHA1}" .
152+
- run:
153+
name: Push application Docker image to docker hub
154+
command: |
155+
if [ "${CIRCLE_BRANCH}" = "master" ]; then
156+
docker tag "cosmwasm/wasmd:${CIRCLE_SHA1}" cosmwasm/wasmd:latest
157+
docker login --password-stdin -u "$DOCKER_USER" \<<<"$DOCKER_PASS"
158+
docker push cosmwasm/wasmd:latest
159+
docker logout
160+
fi
161+
162+
docker-tagged:
163+
executor: golang
164+
steps:
165+
- attach_workspace:
166+
at: /tmp/workspace
167+
- checkout
168+
- setup_remote_docker:
169+
# >= v20.10 https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.14.0#faccessat2
170+
version: 20.10.11
171+
- run:
172+
name: Build Docker artifact
173+
command: docker build --pull -t "cosmwasm/wasmd:${CIRCLE_TAG}" .
174+
- run:
175+
name: Push application Docker image to docker hub
176+
command: |
177+
docker login --password-stdin -u "$DOCKER_USER" \<<<"$DOCKER_PASS"
178+
docker push "cosmwasm/wasmd:${CIRCLE_TAG}"
179+
docker logout
180+
181+
workflows:
182+
version: 2
183+
test-suite:
184+
jobs:
185+
# this is now a slow process... let's only run on master
186+
- docker-image:
187+
requires:
188+
- setup-dependencies
189+
filters:
190+
branches:
191+
only:
192+
- master
193+
- docker-tagged:
194+
filters:
195+
tags:
196+
only:
197+
- /^v.*/
198+
branches:
199+
ignore:
200+
- /.*/
201+
requires:
202+
- setup-dependencies
203+
- setup-dependencies:
204+
# filters here are needed to enable this job also for tags
205+
filters:
206+
tags:
207+
only:
208+
- /^v.*/
209+
- lint:
210+
requires:
211+
- setup-dependencies
212+
- test-cover:
213+
requires:
214+
- setup-dependencies
215+
- upload-coverage:
216+
requires:
217+
- test-cover
218+
- benchmark:
219+
requires:
220+
- test-cover

.codecov.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#
2+
# This codecov.yml is the default configuration for
3+
# all repositories on Codecov. You may adjust the settings
4+
# below in your own codecov.yml in your repository.
5+
#
6+
coverage:
7+
precision: 2
8+
round: down
9+
range: 70...100
10+
11+
status:
12+
# Learn more at https://docs.codecov.io/docs/commit-status
13+
project:
14+
default:
15+
threshold: 1% # allow this much decrease on project
16+
app:
17+
target: 70%
18+
flags:
19+
- app
20+
modules:
21+
target: 70%
22+
flags:
23+
- modules
24+
client:
25+
flags:
26+
- client
27+
changes: false
28+
29+
comment:
30+
layout: "reach, diff, files"
31+
behavior: default # update if exists else create new
32+
require_changes: true
33+
34+
flags:
35+
app:
36+
paths:
37+
- "app/"
38+
modules:
39+
paths:
40+
- "x/"
41+
- "!x/**/client/" # ignore client package
42+
client:
43+
paths:
44+
- "x/**/client/"
45+
46+
ignore:
47+
- "cmd/"
48+
- "contrib/"
49+
- "docs/"
50+
- "docker/"
51+
- "scripts/"
52+
- "*.md"
53+
- "*.rst"
54+
- "x/**/*.pb.go"
55+
- "x/**/*.pb.gw.go"
56+
- "x/**/test_common.go"
57+
- "x/**/testdata/"

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Folders we don't want to copy to Docker daemon in `docker build . -t cosmwasm/wasmd:latest`
2+
build/

.github/workflows/build.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
on: [push, pull_request]
2+
name: meme build commit
3+
jobs:
4+
5+
build:
6+
runs-on: ubuntu-latest
7+
name: build
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Setup go
11+
uses: actions/setup-go@v2
12+
with:
13+
go-version: 1.17
14+
- run: go build ./...
15+
16+
test:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Install Go
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: 1.17
23+
- name: Checkout code
24+
uses: actions/checkout@v2
25+
- name: Test
26+
run: go test ./...

.github/workflows/docker.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: ci
2+
3+
on:
4+
pull_request:
5+
release:
6+
types: [published, created, edited]
7+
push:
8+
tags:
9+
- '*'
10+
branches:
11+
- 'main'
12+
13+
env:
14+
REGISTRY: ghcr.io
15+
IMAGE_NAME: ${{ github.repository }}
16+
17+
jobs:
18+
docker:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v2
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v1
25+
- name: Set up Docker Buildx
26+
uses: docker/setup-buildx-action@v1
27+
- name: Login to GitHub Container Registry
28+
uses: docker/login-action@v1
29+
with:
30+
registry: ghcr.io
31+
username: ${{ github.repository_owner }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
- name: Docker meta
34+
id: meta
35+
uses: docker/metadata-action@v3
36+
with:
37+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
38+
tags: |
39+
type=ref,event=branch
40+
type=ref,event=pr
41+
type=raw,value=pr-latest,event=pr
42+
type=semver,pattern={{raw}}
43+
type=semver,pattern={{version}}
44+
type=semver,pattern={{major}}.{{minor}}
45+
- name: Build and push
46+
uses: docker/build-push-action@v2
47+
with:
48+
context: .
49+
platforms: linux/amd64
50+
push: true
51+
tags: ${{ steps.meta.outputs.tags }}
52+
build-args: arch=x86_64
53+

.github/workflows/go.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Set up Go
17+
uses: actions/setup-go@v3
18+
with:
19+
go-version: 1.17
20+
21+
- name: Build
22+
run: go build -v ./...
23+
24+
- name: Test
25+
run: go test -v ./...

0 commit comments

Comments
 (0)