From 1119663505cdae46963108b5c676cce35b2bb829 Mon Sep 17 00:00:00 2001 From: boytur <104257779+boytur@users.noreply.github.com> Date: Mon, 19 Aug 2024 11:33:32 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore[workflow]:=20update=20GitH?= =?UTF-8?q?ub=20workflow=20fix=20invalid=20path?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/node.js.yml | 40 +++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index d4e38e3..a52801b 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -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: @@ -18,20 +15,35 @@ jobs: node-version: [22.x] steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - working-directory: milkyway-bot/report-server + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + + - name: Print current directory and list files + run: | + echo "Current directory:" + pwd + echo "Listing files in the repository:" + ls -la + + - name: Install dependencies run: | - npm install actions/setup-node@v4 - actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm ci + if [ -f milkyway-bot/report-server/package-lock.json ]; then + npm ci + else + npm install + fi working-directory: milkyway-bot/report-server - - run: npm run build --if-present + - name: Build the project + run: npm run build --if-present working-directory: milkyway-bot/report-server - - run: npm test + - name: Run tests + run: npm test working-directory: milkyway-bot/report-server