From 154e15008a3aa9506d48dc8da334ce84b78eb329 Mon Sep 17 00:00:00 2001 From: Geun-Oh Date: Fri, 29 Mar 2024 01:31:56 +0900 Subject: [PATCH] fix: clarify go version for testing --- .github/scripts/initialize-wrangler.sh | 4 ++++ .github/workflows/test-cloudflarekv.yml | 20 +++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/scripts/initialize-wrangler.sh b/.github/scripts/initialize-wrangler.sh index 0be50154..fb5d0726 100644 --- a/.github/scripts/initialize-wrangler.sh +++ b/.github/scripts/initialize-wrangler.sh @@ -6,6 +6,10 @@ export default { async fetch(Request, env) { const namespace = env.TEST_NAMESPACE1; + if (Request.url === "http://localhost:8787/health") { + return new Response("Success"); + } + if (Request.url === "http://localhost:8787/writeworkerskvkeyvaluepair") { const res = await Request.json(); const { key, val } = res; diff --git a/.github/workflows/test-cloudflarekv.yml b/.github/workflows/test-cloudflarekv.yml index 8f06a759..138ca667 100644 --- a/.github/workflows/test-cloudflarekv.yml +++ b/.github/workflows/test-cloudflarekv.yml @@ -1,4 +1,4 @@ -name: Run CloudflareKV Tests +name: Tests CloudflareKV on: push: @@ -9,18 +9,22 @@ on: - main jobs: - build-and-test: - name: Build and Test + Tests: runs-on: ubuntu-latest + strategy: + matrix: + go-version: + - 1.21.x + - 1.22.x steps: - name: Checkout Repository uses: actions/checkout@v2 - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: - go-version: 1.22.x + go-version: ${{ matrix.go-version }} - name: Setup Node.js uses: actions/setup-node@v3 @@ -30,10 +34,12 @@ jobs: - uses: JarvusInnovations/background-action@v1 name: Bootstrap System Under Test (SUT) with: - run: .github/scripts/initialize-wrangler.sh + run: | + .github/scripts/initialize-wrangler.sh + npx wrangler dev wait-on: | - http://localhost:8787 + http://localhost:8787/health - name: Go to cloudflarekv directory run: cd cloudflarekv