From 35bdff5085a452e9d1e3894401cc7def78a8a6ca Mon Sep 17 00:00:00 2001 From: "Satana Charuwichitratana (Mick)" Date: Fri, 25 Apr 2025 18:06:20 +0700 Subject: [PATCH 1/7] fix: Build and test node 24-alpine --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 357d2ca5..9f19b73f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -6,7 +6,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [20, 22] + node-version: [20, 22, 24] steps: - name: Checkout uses: actions/checkout@v4 From 57a66a1ffbe38533a402a9aca9409aa521b550ed Mon Sep 17 00:00:00 2001 From: "Satana Charuwichitratana (Mick)" Date: Wed, 7 May 2025 12:15:08 +0700 Subject: [PATCH 2/7] fix: Remove global flag, recent @medusajs/cli not working properly in global --- .github/workflows/pull-request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 9f19b73f..7611c97b 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -15,7 +15,7 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: Set up Medusa CLI - run: npm i -g @medusajs/cli + run: npm i @medusajs/cli - name: Create a test project run: npx medusa new -y --skip-db --skip-migrations test - name: Copy Dockerfile to the test project From 8ae94a0c0bb97127c0970a77086c118540112ca6 Mon Sep 17 00:00:00 2001 From: "Satana Charuwichitratana (Mick)" Date: Wed, 7 May 2025 12:23:10 +0700 Subject: [PATCH 3/7] fix(ci): specific build test only PR to main --- .github/workflows/pull-request.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 7611c97b..11764dd8 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -1,5 +1,8 @@ name: Build docker images on PR -on: pull_request +on: + pull_request: + branches: + - main jobs: build: name: Test build for Node.js ${{ matrix.node-version }} @@ -15,9 +18,9 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: Set up Medusa CLI - run: npm i @medusajs/cli + run: npm i @medusajs/cli - name: Create a test project - run: npx medusa new -y --skip-db --skip-migrations test + run: npx medusa new -y --skip-db --skip-migrations test - name: Copy Dockerfile to the test project run: cp Dockerfile .dockerignore test/ - name: Set up QEMU From 193d54f25538469daa81cbb40af6d868647e3f26 Mon Sep 17 00:00:00 2001 From: "Satana Charuwichitratana (Mick)" Date: Wed, 7 May 2025 12:28:38 +0700 Subject: [PATCH 4/7] test: patch with number-float64-base-normalize --- .github/workflows/pull-request.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 11764dd8..1c4e7ea8 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -18,7 +18,9 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: Set up Medusa CLI - run: npm i @medusajs/cli + run: | + npm i -g @stdlib/number-float64-base-normalize@0.0.8 + npm i -g @medusajs/cli - name: Create a test project run: npx medusa new -y --skip-db --skip-migrations test - name: Copy Dockerfile to the test project From 34bc610b194fe8090772357e7b52c15a04f11e59 Mon Sep 17 00:00:00 2001 From: "Satana Charuwichitratana (Mick)" Date: Wed, 7 May 2025 12:39:54 +0700 Subject: [PATCH 5/7] fix: Specify permissions --- .github/workflows/pull-request.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 1c4e7ea8..da59ac4f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -3,6 +3,8 @@ on: pull_request: branches: - main +permissions: + contents: read jobs: build: name: Test build for Node.js ${{ matrix.node-version }} @@ -18,9 +20,7 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: Set up Medusa CLI - run: | - npm i -g @stdlib/number-float64-base-normalize@0.0.8 - npm i -g @medusajs/cli + run: npm i -g @medusajs/cli - name: Create a test project run: npx medusa new -y --skip-db --skip-migrations test - name: Copy Dockerfile to the test project From b40529c0e02c2ae2e512894508099399505f8136 Mon Sep 17 00:00:00 2001 From: "Satana Charuwichitratana (Mick)" Date: Wed, 7 May 2025 13:17:00 +0700 Subject: [PATCH 6/7] fix: Clone test project directly --- .github/workflows/pull-request.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index da59ac4f..b334457c 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -19,10 +19,8 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - - name: Set up Medusa CLI - run: npm i -g @medusajs/cli - name: Create a test project - run: npx medusa new -y --skip-db --skip-migrations test + run: git clone --depth 1 git@github.com:medusajs/medusa-starter-default.git test - name: Copy Dockerfile to the test project run: cp Dockerfile .dockerignore test/ - name: Set up QEMU From c42a0f7141ff0c17a17e5cfc87c51a1316169c2d Mon Sep 17 00:00:00 2001 From: "Satana Charuwichitratana (Mick)" Date: Wed, 7 May 2025 13:20:09 +0700 Subject: [PATCH 7/7] fix: Use checkout action to clone test project --- .github/workflows/pull-request.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index b334457c..9599a22a 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -3,8 +3,6 @@ on: pull_request: branches: - main -permissions: - contents: read jobs: build: name: Test build for Node.js ${{ matrix.node-version }} @@ -20,7 +18,10 @@ jobs: with: node-version: ${{ matrix.node-version }} - name: Create a test project - run: git clone --depth 1 git@github.com:medusajs/medusa-starter-default.git test + uses: actions/checkout@v4 + with: + repository: medusajs/medusa-starter-default + path: test - name: Copy Dockerfile to the test project run: cp Dockerfile .dockerignore test/ - name: Set up QEMU