Skip to content

Commit

Permalink
CI:セットアップ
Browse files Browse the repository at this point in the history
Update Node.js CI workflow

Refactored the node.js CI workflow to streamline steps and organize them under the 'app' directory. Removed extraneous comments for clarity and added working-directory parameter to relevant steps for better directory management.
  • Loading branch information
k2works committed Oct 3, 2024
1 parent a0107d6 commit 4ce336f
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# 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: Node.js CI

on:
Expand All @@ -11,21 +8,29 @@ on:

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 19.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm test
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
working-directory: app

- name: Install dependencies
run: npm ci
working-directory: app

- name: Build
run: npm run build --if-present
working-directory: app

- name: Run tests
run: npm test
working-directory: app

0 comments on commit 4ce336f

Please sign in to comment.