From b7be3295506b9c5ec01d3e35a2cd119ae668566c Mon Sep 17 00:00:00 2001 From: Yaiba <4yaiba@gmail.com> Date: Wed, 26 Feb 2025 16:25:47 -0600 Subject: [PATCH] update ci kgw --- .github/workflows/kgw-test-reuse.yaml | 40 ++++++++++++++++++--------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/.github/workflows/kgw-test-reuse.yaml b/.github/workflows/kgw-test-reuse.yaml index 95bcd3591..ec3e7659c 100644 --- a/.github/workflows/kgw-test-reuse.yaml +++ b/.github/workflows/kgw-test-reuse.yaml @@ -109,35 +109,49 @@ jobs: # if kgw on non-release branches, we want to use go workspace, so that kgw # always uses the latest version of kwil-db/core run: | - echo "KWK_DIR=$(pwd)/.." >> $GITHUB_ENV +# kdbDir=$(pwd) +# echo "KDB_DIR=$(pwd)" >> $GITHUB_ENV +# echo "current dir: " $kdbDir +# cd .. +# rm -rf ./kgw +# git config --global url."https://${GH_ACCESS_TOKEN}:x-oauth-basic@github.com/kwilteam/".insteadOf "https://github.com/kwilteam/" +# git clone -b ${{ inputs.kgw-ref }} https://github.com/kwilteam/kgw.git ./kgw +# rm -rf ~/.gitconfig +# cd ./kgw +# echo "KGW_DIR=$(pwd)" >> $GITHUB_ENV +# if [[ ${{ inputs.kgw-ref }} == release-* ]]; then +# go mod vendor +# else +# # non release branch, use go workspace to always use the latest version of kwil-db/core +# test -f go.work || go work init . ../kwil-db/core +# go work vendor +# fi +# cd - +# cd $kdbDir + kdbDir=$(pwd) - echo "KDB_DIR=$(pwd)" >> $GITHUB_ENV - echo "current dir: " $kdbDir - cd .. - rm -rf ./kgw git config --global url."https://${GH_ACCESS_TOKEN}:x-oauth-basic@github.com/kwilteam/".insteadOf "https://github.com/kwilteam/" - git clone -b ${{ inputs.kgw-ref }} https://github.com/kwilteam/kgw.git ./kgw + rm -rf /tmp/kgw + git clone -b ${{ inputs.kgw-ref }} https://github.com/kwilteam/kgw.git /tmp/kgw rm -rf ~/.gitconfig - cd ./kgw - echo "KGW_DIR=$(pwd)" >> $GITHUB_ENV + cd /tmp/kgw if [[ ${{ inputs.kgw-ref }} == release-* ]]; then go mod vendor else # non release branch, use go workspace to always use the latest version of kwil-db/core - test -f go.work || go work init . ../kwil-db/core + test -f go.work || go work init . $kdbDir/core go work vendor fi cd - - cd $kdbDir - name: Build kgw image id: docker_build_kgw - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: - context: ${{ env.KGW_DIR }}/.. + context: /tmp/kgw load: true builder: ${{ steps.buildx.outputs.name }} - file: ${{ env.KGW_DIR }}/Dockerfile.workspace + file: /tmp/kgw/Dockerfile.workspace push: false tags: kgw:latest cache-from: type=local,src=/tmp/.buildx-cache-kgw