From 96ed9d68741cfcf767f1a0b922ac80c16b322439 Mon Sep 17 00:00:00 2001 From: boytur <104257779+boytur@users.noreply.github.com> Date: Mon, 19 Aug 2024 11:14:06 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore[workflow]:=20setup=20githu?= =?UTF-8?q?b=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/node.js.yml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 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..d4e38e3 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,37 @@ +# 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: + push: + branches: ["master", "develop"] + pull_request: + branches: ["master", "develop"] + +jobs: + build: + runs-on: self-hosted + + strategy: + matrix: + node-version: [22.x] + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + working-directory: milkyway-bot/report-server + run: | + npm install actions/setup-node@v4 + actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + working-directory: milkyway-bot/report-server + + - run: npm run build --if-present + working-directory: milkyway-bot/report-server + + - run: npm test + working-directory: milkyway-bot/report-server