-
Notifications
You must be signed in to change notification settings - Fork 20
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
integrate with e2e test #135
Changes from 20 commits
cdf122e
54b0dbb
c4631c9
4496cd9
72384f6
916bd85
ef20c80
8e7c007
f5bd57b
90065ef
4802988
9f2ada8
163586b
13599c5
2f96e36
4b55037
b5a6ded
5551a35
933d82d
7722cf2
9334e81
1f4ec48
63d2e67
c014c03
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ jobs: | |
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.16 | ||
go-version: 1.17 | ||
- uses: actions/checkout@v2 | ||
- name: gentx-validation | ||
run: | | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,11 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.17 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
uses: golangci/golangci-lint-action@v3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. upgrade linter version to avoid the folloing error failed to load package goarch |
||
with: | ||
version: v1.29 | ||
version: v1.44.2 | ||
args: --timeout=3m |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. now e2e is ready on the github workflow |
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
jobs: | ||
test-e2e: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 25 | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
go-version: 1.17 | ||
- uses: actions/checkout@v2 | ||
- 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 | ||
run: | | ||
make test-e2e | ||
if: env.GIT_DIFF |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
run: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
tests: false | ||
skip-dirs: | ||
- tests/e2e |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,3 +71,22 @@ lint: | |
|
||
build: | ||
go build $(BUILD_FLAGS) -o build/nibirud ./cmd/nibirud | ||
|
||
################################################################### | ||
### E2E Tests ### | ||
################################################################### | ||
PACKAGES_E2E=$(shell go list ./... | grep '/e2e') | ||
|
||
# build a node container | ||
.PHONY: docker-build-debug | ||
docker-build-debug: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. building the docker for running nibiru node |
||
@docker build -t cosmos/nibirud-e2e --build-arg IMG_TAG=debug -f e2e.Dockerfile . | ||
|
||
# build a relayer container | ||
.PHONY: docker-build-hermes | ||
docker-build-hermes: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. building the docker for running relayer |
||
@cd tests/e2e/docker; docker build -t cosmos/hermes-e2e:latest -f hermes.Dockerfile . | ||
|
||
.PHONY: test-e2e | ||
test-e2e: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. executing all test cases in e2e |
||
@go test -mod=readonly -timeout=25m -v $(PACKAGES_E2E) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ARG IMG_TAG=latest | ||
|
||
# Compile the nibirud binary | ||
FROM golang:1.17-alpine AS nibirud-builder | ||
WORKDIR /src/app/ | ||
COPY go.mod go.sum* ./ | ||
RUN go mod download | ||
COPY . . | ||
ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 | ||
RUN apk add --no-cache $PACKAGES | ||
RUN CGO_ENABLED=0 make install | ||
|
||
# Add to a distroless container | ||
FROM gcr.io/distroless/cc:$IMG_TAG | ||
ARG IMG_TAG | ||
COPY --from=nibirud-builder /go/bin/nibirud /usr/local/bin/ | ||
EXPOSE 26656 26657 1317 9090 | ||
|
||
ENTRYPOINT ["nibirud", "start"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this setting is required from linter@v3
https://github.com/golangci/golangci-lint-action#compatibility