From c4c8b6146c5f981f259fa3f0a84b89904aa61342 Mon Sep 17 00:00:00 2001 From: Hanasa <62538473+nnivxix@users.noreply.github.com> Date: Thu, 3 Oct 2024 20:53:53 +0700 Subject: [PATCH 1/6] Create node.js.yml --- .github/workflows/node.js.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..7c3c2cd --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,29 @@ +# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs + +name: Vitest + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm test From 6b3b3c04f38812775058755c9bffed17c5d9599a Mon Sep 17 00:00:00 2001 From: Hanasa <62538473+nnivxix@users.noreply.github.com> Date: Thu, 3 Oct 2024 20:56:43 +0700 Subject: [PATCH 2/6] Update node.js.yml --- .github/workflows/node.js.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 7c3c2cd..2528f7e 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: - node-version: [18.x, 20.x, 22.x] + node-version: [ 20.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: @@ -25,5 +25,5 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm test + cache: 'pnpm' + - run: pnpm test From e2bf33e4949c222d953b5df6149c9d7e815a6e13 Mon Sep 17 00:00:00 2001 From: Hanasa <62538473+nnivxix@users.noreply.github.com> Date: Thu, 3 Oct 2024 21:03:00 +0700 Subject: [PATCH 3/6] Update node.js.yml --- .github/workflows/node.js.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 2528f7e..b91ce74 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,14 +16,27 @@ jobs: strategy: matrix: - node-version: [ 20.x] + node-version: [ 20.x ] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - uses: actions/checkout@v4 + + # Setup Node.js version - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' - - run: pnpm test + + # Install pnpm + - name: Install pnpm + run: npm install -g pnpm + + # Install dependencies using pnpm + - name: Install dependencies + run: pnpm install + + # Run tests using pnpm + - name: Run tests + run: pnpm test From d9458f13172d764473cdf228af7fbea54b49970f Mon Sep 17 00:00:00 2001 From: Hanasa <62538473+nnivxix@users.noreply.github.com> Date: Thu, 3 Oct 2024 21:06:46 +0700 Subject: [PATCH 4/6] Update node.js.yml --- .github/workflows/node.js.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index b91ce74..cbc086a 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -29,6 +29,10 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'pnpm' + - name: Setup pnpm + uses: pnpm/action-setup@v2.2.4 + with: + version: 9.9.0 # Install pnpm - name: Install pnpm run: npm install -g pnpm From e791952e629bd21f1d0c9602d70e49a5c56ec974 Mon Sep 17 00:00:00 2001 From: Hanasa <62538473+nnivxix@users.noreply.github.com> Date: Thu, 3 Oct 2024 21:10:25 +0700 Subject: [PATCH 5/6] Update node.js.yml --- .github/workflows/node.js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index cbc086a..d65523f 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -27,7 +27,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - cache: 'pnpm' + cache: 'npm' - name: Setup pnpm uses: pnpm/action-setup@v2.2.4 From 21533d462df045ec5435c26d006df9f52351b50f Mon Sep 17 00:00:00 2001 From: Hanasa <62538473+nnivxix@users.noreply.github.com> Date: Thu, 3 Oct 2024 21:18:11 +0700 Subject: [PATCH 6/6] Update node.js.yml --- .github/workflows/node.js.yml | 62 +++++++++++++---------------------- 1 file changed, 22 insertions(+), 40 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index d65523f..2e99cdc 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -1,46 +1,28 @@ -# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs - -name: Vitest - on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + - push + - pull_request jobs: - build: - + cache-and-install: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [ 20.x ] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - steps: - - uses: actions/checkout@v4 - - # Setup Node.js version - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - - name: Setup pnpm - uses: pnpm/action-setup@v2.2.4 - with: - version: 9.9.0 - # Install pnpm - - name: Install pnpm - run: npm install -g pnpm - - # Install dependencies using pnpm - - name: Install dependencies - run: pnpm install - - # Run tests using pnpm - - name: Run tests - run: pnpm test + - name: Checkout + uses: actions/checkout@v4 + + - uses: pnpm/action-setup@v4 + name: Install pnpm + with: + version: 9 + run_install: false + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + - name: Run Test + run: pnpm test