From 0c23add696d93a4d5eef87145e3de168690c6fdc Mon Sep 17 00:00:00 2001 From: Ajeet Goyal Date: Thu, 28 Mar 2024 15:17:07 +0530 Subject: [PATCH] ci: heighliner docker image (#313) --- .github/workflows/e2e-testing.yaml | 4 +- .github/workflows/e2e-upgrade.yaml | 74 ------------------------------ .github/workflows/release.yml | 32 +++++++++++++ Makefile | 4 +- 4 files changed, 36 insertions(+), 78 deletions(-) delete mode 100644 .github/workflows/e2e-upgrade.yaml diff --git a/.github/workflows/e2e-testing.yaml b/.github/workflows/e2e-testing.yaml index accc9931..16dafd40 100644 --- a/.github/workflows/e2e-testing.yaml +++ b/.github/workflows/e2e-testing.yaml @@ -65,7 +65,7 @@ jobs: - name: Setup Go with cache uses: magnetikonline/action-golang-cache@v4 with: - go-version: 1.20.0 + go-version: 1.21.0 id: go - name: Checkout repository @@ -104,7 +104,7 @@ jobs: - name: Setup Go with cache uses: magnetikonline/action-golang-cache@v4 with: - go-version: 1.20.0 + go-version: 1.21.0 id: go - name: Checkout repository diff --git a/.github/workflows/e2e-upgrade.yaml b/.github/workflows/e2e-upgrade.yaml deleted file mode 100644 index 8989f83d..00000000 --- a/.github/workflows/e2e-upgrade.yaml +++ /dev/null @@ -1,74 +0,0 @@ -name: E2E Upgrade tests - -on: - push: - branches: - - main - paths: - - starship/** - pull_request: - branches: - - main - - 'ajeet/sdk-v47' # TODO(ajeet): remove this when e2e PR is merged - paths: - - starship/** - -jobs: - e2e-v7v8-test: - runs-on: ubuntu-latest - timeout-minutes: 30 - - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Go 1.x - uses: actions/setup-go@v2 - with: - go-version: ^1.19 - id: go - - - name: Set namespace - id: set-namespace - run: | - namespace="ci-${{ github.repository_owner }}-${{ github.workflow }}-${{ github.ref }}" - echo "Setting namespace to $namespace" - echo "namespace=$namespace" >> $GITHUB_OUTPUT - - # Starship Infra setup - # - Connects to k8s cluster with kubeconfig (digital ocean) - # - Creates a new namespace based on the name (deleted in next step) - # - Spins up the infra with the given config file - # - Waits till all nodes are running (timeout 30m) - # - Port forward all ports to localhost for next steps to connect - - name: Setup Test infra - id: starship-action - uses: cosmology-tech/starship-action@0.2.12 - with: - values: starship/v7v8/config.yaml - port-forward: true - version: 0.1.37 - kubeconfig: ${{ secrets.KUBECONFIG }} - namespace: ${{ steps.set-namespace.outputs.namespace }} - repo: https://raw.githubusercontent.com/persistenceOne/starship/ajeet/sdk-v47/helm_repo - - - name: Run Tests - run: | - cd starship/v7v8/ - go mod tidy - make test - - # Starship resource cleanup on cluster - # todo(@anmol1696): change this to be post step of the action - - name: Cleanup cluster - if: always() - run: | - helm delete $DEVNET_NAME --debug --namespace $DEVNET_NAMESPACE --wait || true - kubectl delete namespace $DEVNET_NAMESPACE --wait=true || true - env: - DEVNET_NAME: ${{ steps.starship-action.outputs.name }} - DEVNET_NAMESPACE: ${{ steps.starship-action.outputs.namespace }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 828d3dd8..4c3a14fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,3 +33,35 @@ jobs: files: release/* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + docker: + runs-on: ubuntu-latest + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Log in to the Container registry + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Get branch name + id: branch-name + uses: tj-actions/branch-names@v7 + + - name: Build and push Docker image + uses: strangelove-ventures/heighliner-build-action@v1.0.0 + with: + platform: linux/arm64,linux/amd64 + git-ref: ${{ steps.branch-name.outputs.current_branch }} + registry: docker.io/persistenceone + tag: ${{ github.ref_name }} + chain: persistencecore + dockerfile: cosmos + build-target: make install + binaries: | + - /go/bin/persistenceCore + build-env: | + - LEDGER_ENABLED=false + - BUILD_TAGS=muslc diff --git a/Makefile b/Makefile index aad73eab..b861c4ef 100644 --- a/Makefile +++ b/Makefile @@ -224,13 +224,13 @@ release-git: get-heighliner: git clone https://github.com/strangelove-ventures/heighliner.git - cd heighliner && go install + cd heighliner && git checkout v1.5.4 && go install local-image: ifeq (,$(shell which heighliner)) echo 'heighliner' binary not found. Consider running `make get-heighliner` else - heighliner build -c persistence --local -f ./chains.yaml + heighliner build -c persistence --go-version 1.21 --local -f ./chains.yaml endif .PHONY: get-heighliner local-image