From c40edc41b24bb40fd56518ea97a9fcf4b656bf47 Mon Sep 17 00:00:00 2001 From: "jaeseung.bae" Date: Wed, 22 Nov 2023 19:16:58 +0900 Subject: [PATCH] ci: add e2e-ibc ci --- .github/workflows/e2e-ibc.yml | 85 ++++++++++++++++++++++++++++++ Makefile | 27 +++++----- interchaintest/conformance_test.go | 2 +- 3 files changed, 101 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/e2e-ibc.yml diff --git a/.github/workflows/e2e-ibc.yml b/.github/workflows/e2e-ibc.yml new file mode 100644 index 00000000..16c76b33 --- /dev/null +++ b/.github/workflows/e2e-ibc.yml @@ -0,0 +1,85 @@ +name: E2E-IBC + +on: + pull_request: + push: + tags: + - "**" + branches: + - "main" + +permissions: + contents: read + packages: write + +env: + GO_VERSION: '1.20' + TAR_PATH: /tmp/fnsad-docker-image.tar + IMAGE_NAME: fnsad + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-docker: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Go ${{ env.GO_VERSION }} + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + cache-dependency-path: interchaintest/go.sum + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and export + uses: docker/build-push-action@v5 + with: + context: . + tags: fnsad:local + outputs: type=docker,dest=${{ env.TAR_PATH }} + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ env.IMAGE_NAME }} + path: ${{ env.TAR_PATH }} + + e2e-tests: + needs: build-docker + runs-on: ubuntu-latest + strategy: + matrix: + # names of `make` commands to run tests + test: + - "test-e2e-ibc" + fail-fast: false + + steps: + - name: Set up Go ${{ env.GO_VERSION }} + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + cache-dependency-path: interchaintest/go.sum + + - name: checkout chain + uses: actions/checkout@v4 + + - name: Download Tarball Artifact + uses: actions/download-artifact@v3 + with: + name: ${{ env.IMAGE_NAME }} + path: /tmp + + - name: Load Docker Image + run: | + docker image load -i ${{ env.TAR_PATH }} + docker image ls -a + + - name: Run Test + run: make ${{ matrix.test }} \ No newline at end of file diff --git a/Makefile b/Makefile index 6e4aa2ad..8798fe55 100644 --- a/Makefile +++ b/Makefile @@ -142,7 +142,18 @@ go-mod-cache: go.sum @echo "--> Download go modules to local cache" @go mod download -.PHONY: all build install clean wasmvmlib build-reproducible +get-heighliner: + git clone https://github.com/strangelove-ventures/heighliner.git $(TEMPDIR)/heighliner + cd $(TEMPDIR)/heighliner && go install + +local-image: +ifeq (,$(shell which heighliner)) + echo 'heighliner' binary not found. Consider running `make get-heighliner` +else + heighliner build -c finschia --local --dockerfile cosmos --build-target "wget https://github.com/Finschia/wasmvm/releases/download/$(WASMVM_VERSION)/libwasmvm_muslc.aarch64.a -O /lib/libwasmvm.aarch64.a && make install" --binaries "/go/bin/fnsad" +endif + +.PHONY: all build install clean wasmvmlib build-reproducible get-heighliner local-image ############################################################################### @@ -176,18 +187,10 @@ test-integration-multi-node: docker-build test-upgrade-name: @sh contrib/check-upgrade-name.sh -get-heighliner: - git clone https://github.com/strangelove-ventures/heighliner.git $(TEMPDIR)/heighliner - cd $(TEMPDIR)/heighliner && go install - -local-image: -ifeq (,$(shell which heighliner)) - echo 'heighliner' binary not found. Consider running `make get-heighliner` -else - heighliner build -c finschia --local --dockerfile cosmos --build-target "wget https://github.com/Finschia/wasmvm/releases/download/$(WASMVM_VERSION)/libwasmvm_muslc.aarch64.a -O /lib/libwasmvm.aarch64.a && make install" --binaries "/go/bin/fnsad" -endif +test-e2e-ibc: + cd interchaintest && go test -v ./... -.PHONY: test test-all test-unit test-race test-cover benchmark test-integration test-integration-multi-node get-heighliner local-image +.PHONY: test test-all test-unit test-race test-cover benchmark test-integration test-integration-multi-node test-e2e-ibc ############################################################################### ### Docker ### diff --git a/interchaintest/conformance_test.go b/interchaintest/conformance_test.go index 301f6fdc..1378c08c 100644 --- a/interchaintest/conformance_test.go +++ b/interchaintest/conformance_test.go @@ -41,7 +41,7 @@ func latestFinschiaChain(numOfValidators, numOfFullNodes int) *interchaintest.Ch ChainID: "finschia-2", Images: []ibc.DockerImage{ { - Repository: "finschia", + Repository: "fnsad", Version: "local", UidGid: "1025:1025", },