-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into faddat/tm-db-master
- Loading branch information
Showing
118 changed files
with
5,949 additions
and
2,521 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,65 +2,128 @@ name: Tests & Code Coverage | |
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- "**" | ||
push: | ||
branches: | ||
- "main" | ||
- "v[0-9]**" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
should_run_go_test: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
should_skip: ${{ steps.skip_check.outputs.should_skip }} | ||
steps: | ||
- id: skip_check | ||
- | ||
id: skip_check | ||
uses: fkirc/skip-duplicate-actions@master | ||
with: | ||
cancel_others: "true" # workflow-runs from outdated commits will be cancelled. | ||
concurrent_skipping: "same_content" | ||
skip_after_successful_duplicate: "true" | ||
paths: '["**/*.go", "**/*.mod", "**/*.sum"]' | ||
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]' | ||
- name: Skipping test | ||
- | ||
name: Skipping test | ||
run: echo Should I skip tests? ${{ steps.skip_check.outputs.should_skip }} | ||
|
||
go_test: | ||
needs: should_run_go_test | ||
if: ${{ needs.should_run_test.outputs.should_skip != 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
- | ||
name: Check out repository code | ||
uses: actions/checkout@v2 | ||
- name: Setup Golang | ||
- | ||
name: Setup Golang | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.18 | ||
- name: Display go version | ||
- | ||
name: Display go version | ||
run: go version | ||
- name: Run all tests | ||
run: | | ||
make test-cover | ||
- name: Codecov | ||
- | ||
name: Get data from build cache | ||
uses: actions/cache@v2 | ||
with: | ||
# In order: | ||
# * Module download cache | ||
# * Build cache (Linux) | ||
# * Build cache (Mac) | ||
# * Build cache (Windows) | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
~\AppData\Local\go-build | ||
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-${{ matrix.go-version }}- | ||
- | ||
name: Run all tests | ||
run: make test-cover | ||
- | ||
name: Codecov | ||
uses: codecov/[email protected] | ||
|
||
e2e_test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 25 | ||
steps: | ||
- uses: actions/[email protected] | ||
- | ||
name: Setup Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.18 | ||
- uses: actions/checkout@v2 | ||
- uses: technote-space/[email protected] | ||
- | ||
name: Check out repository code | ||
uses: actions/checkout@v2 | ||
- | ||
name: Get git diff | ||
uses: technote-space/[email protected] | ||
with: | ||
PATTERNS: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
- name: Build Docker Image | ||
run: | | ||
make docker-build-debug | ||
if: env.GIT_DIFF | ||
- name: Test E2E and Upgrade | ||
run: | | ||
make test-e2e | ||
if: env.GIT_DIFF | ||
- | ||
name: Get data from build cache | ||
uses: actions/cache@v2 | ||
with: | ||
# In order: | ||
# * Module download cache | ||
# * Build cache (Linux) | ||
# * Build cache (Mac) | ||
# * Build cache (Windows) | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/go-build | ||
~/Library/Caches/go-build | ||
~\AppData\Local\go-build | ||
key: ${{ runner.os }}-go-docker-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go-docker-${{ matrix.go-version }}- | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- | ||
name: Build e2e image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
load: true | ||
context: . | ||
tags: osmosis:debug | ||
# Use experimental Cache backend API: https://github.com/docker/build-push-action/blob/master/docs/advanced/cache.md#cache-backend-api | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
build-args: | | ||
BASE_IMG_TAG=debug | ||
- | ||
name: Test e2e and Upgrade | ||
run: make test-e2e |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Default state for all rules | ||
default: true | ||
MD024: false | ||
MD003: | ||
# Heading style | ||
style: "atx" |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,46 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
ARG BASE_IMG_TAG=nonroot | ||
ARG BASE_IMG_TAG=nonroot | ||
|
||
# -------------------------------------------------------- | ||
# Build | ||
# -------------------------------------------------------- | ||
|
||
## Build Image | ||
FROM golang:1.18.2-alpine3.15 as build | ||
|
||
RUN set -eux; apk add --no-cache ca-certificates build-base; | ||
|
||
RUN apk add git | ||
|
||
# needed by github.com/zondax/hid | ||
# Needed by github.com/zondax/hid | ||
RUN apk add linux-headers | ||
|
||
WORKDIR /osmosis | ||
COPY . /osmosis | ||
|
||
# From https://github.com/CosmWasm/wasmd/blob/master/Dockerfile | ||
# For more details see https://github.com/CosmWasm/wasmvm#builds-of-libwasmvm | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.a | ||
RUN sha256sum /lib/libwasmvm_muslc.a | grep f6282df732a13dec836cda1f399dd874b1e3163504dbd9607c6af915b2740479 | ||
# CosmWasm: see https://github.com/CosmWasm/wasmvm/releases | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0/libwasmvm_muslc.aarch64.a /lib/libwasmvm_muslc.aarch64.a | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/v1.0.0/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a | ||
RUN sha256sum /lib/libwasmvm_muslc.aarch64.a | grep 7d2239e9f25e96d0d4daba982ce92367aacf0cbd95d2facb8442268f2b1cc1fc | ||
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep f6282df732a13dec836cda1f399dd874b1e3163504dbd9607c6af915b2740479 | ||
|
||
# CosmWasm: copy the right library according to architecture. The final location will be found by the linker flag `-lwasmvm_muslc` | ||
RUN cp /lib/libwasmvm_muslc.$(uname -m).a /lib/libwasmvm_muslc.a | ||
|
||
RUN BUILD_TAGS=muslc LINK_STATICALLY=true make build | ||
|
||
## Deploy image | ||
# -------------------------------------------------------- | ||
# Runner | ||
# -------------------------------------------------------- | ||
|
||
FROM gcr.io/distroless/base-debian11:${BASE_IMG_TAG} | ||
|
||
COPY --from=build /osmosis/build/osmosisd /bin/osmosisd | ||
|
||
ENV HOME /osmosis | ||
WORKDIR $HOME | ||
|
||
EXPOSE 26656 | ||
EXPOSE 26656 | ||
EXPOSE 26657 | ||
EXPOSE 1317 | ||
|
||
ENTRYPOINT ["osmosisd"] | ||
CMD [ "start" ] | ||
CMD [ "start" ] |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.