diff --git a/.env b/.env index 3cb0aadc7..6c4e4dec5 100644 --- a/.env +++ b/.env @@ -1,5 +1,6 @@ # version GOLANG_VERSION=1.22.5 +XK6_VERSION=0.11.0 # service SERVICE_NAME=pipeline-backend diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 23cc7a9e0..13a9c3c51 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -88,9 +88,14 @@ jobs: EDITION=local-ce:test \ docker compose -f docker-compose.yml -f docker-compose-latest.yml rm -f + - uses: actions/setup-go@v3 + with: + go-version: ${{ env.GOLANG_VERSION }} + - name: Install k6 run: | - curl https://github.com/grafana/k6/releases/download/v${{ env.K6_VERSION }}/k6-v${{ env.K6_VERSION }}-linux-amd64.tar.gz -L | tar xvz --strip-components 1 && sudo cp k6 /usr/bin + - go install go.k6.io/xk6/cmd/xk6@v${{ env.XK6_VERSION }} + - xk6 build --with github.com/grafana/xk6-sql --output /usr/bin/k6 - name: Checkout (pipeline) uses: actions/checkout@v3 diff --git a/Dockerfile.dev b/Dockerfile.dev index 72ac2503b..b9cf019e3 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -6,7 +6,7 @@ WORKDIR /${SERVICE_NAME} # -- install 3rd-party -ARG TARGETOS TARGETARCH +ARG TARGETOS TARGETARCH XK6_VERSION # Install Python, create virtual environment, and install pdfplumber RUN apt update && \ @@ -34,7 +34,7 @@ RUN npm install -g @opendocsg/pdf2md RUN --mount=target=. --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg GOOS=$TARGETOS GOARCH=$TARGETARCH go install github.com/cosmtrek/air@v1.49 # k6 -RUN go install go.k6.io/xk6/cmd/xk6@v0.11.0 +RUN go install go.k6.io/xk6/cmd/xk6@v${XK6_VERSION} RUN xk6 build --with github.com/grafana/xk6-sql --output /usr/bin/k6 # -- set up Go diff --git a/Makefile b/Makefile index 6de420a2b..2e30963a9 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ build: ## Build dev docker image @docker build \ --build-arg SERVICE_NAME=${SERVICE_NAME} \ --build-arg GOLANG_VERSION=${GOLANG_VERSION} \ + --build-arg K6_VERSION=${K6_VERSION} \ -f Dockerfile.dev -t instill/${SERVICE_NAME}:dev . .PHONY: run-dev-services