How to run meshery-istio (or any adapter, for that matter) in Github workflow (ci.yaml)

Hi @MarioArriaga92 , thanks for the feedback. It looks like that the type io.ReadAll lost in the utils.go. We can do a PR for this.

1 Like

Thanks @Aisuko, should I open an issue for this in meshery-istio adapter repo?

@aisuko, @Lee or any one in #meshery community, can anyone please confirm if below snippet of Github actions workflow yaml is the correct and recommended way to run the adapter locally and have it accessible to meshery server? (specifically Here are tests that need meshery-istio job, Check out meshery-istio code step and Run meshery-istio step, if so let’s mark this reply as a solution)

ci.yaml:

name: Meshery
on:
  pull_request:
    branches:
      - 'master'
jobs:

# ... (Removed some steps for go linting for brevity)

  build-backend:
    name: Backend build
    if: github.repository == 'meshery/meshery'
    runs-on: ubuntu-latest
    steps:
    - name: Check out code
      uses: actions/checkout@master
      with:
        fetch-depth: 1
    - name: Setup Go
      uses: actions/setup-go@v2
      with:
        go-version: '1.16.7'
    - name: Setup Cache
      uses: actions/cache@v2
      with:
        path: ~/go/pkg/mod
        key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
        restore-keys: |
          ${{ runner.os }}-go-
    - run: |
        GOPROXY=https://proxy.golang.org,direct GOSUMDB=off GO111MODULE=on go build -tags draft ./cmd/main.go
    - name: Upload artifacts
      uses: actions/upload-artifact@v2
      with:
        name: meshery
        path: ./main

  tests:
    needs: [build-backend]
    name: Here are tests that need meshery-istio
    if: github.repository == 'meshery/meshery'
    runs-on: ubuntu-latest
    steps:
      - name: Check out code
        uses: actions/checkout@v2
        with:
          fetch-depth: 0
      - name: Check out meshery-istio code
        uses: actions/checkout@v2
        with:
          repository: layer5io/meshery-istio
          path: ./meshery-istio
      - name: Download artifacts
        uses: actions/download-artifact@v2
        with:
          name: meshery
      - name: Setup go
        uses: actions/setup-go@v2
        with:
          go-version: ${{ secrets.GO_VERSION }}
      - name: Create k8s Kind Cluster
        uses: helm/kind-action@v1.1.0
        with:
          cluster_name: "kind-cluster"
      - name: Run meshery-istio
        run: |
          mkdir -p /home/runner/.meshery/bin
          cd ./meshery-istio
          go run main.go &
          sleep 60
      - name: Run backend
        env:
          PROVIDER_BASE_URLS: http://localhost:9876
          PORT: 9081
          ADAPTER_URLS: "localhost:10000 localhost:10001 localhost:10002 localhost:10003 localhost:10004 localhost:10008 localhost:10009 localhost:10007"
        run: |
          chmod +x ./main
          ./main &

# ... (Removed some steps for setting up and running tests for brevity)

Of course, please do this. Thank you.

It’s looks one way we test the adapter. I’m not sure it is a standard way for projects. ping @Lee

1 Like

@MarioArriaga92 This is due to stale go version used in github secrets. A quick fix will be to replace all instances of {{ secrets.GO_VERSION }} with ‘1.17’

1 Like