From 3cb0abb38a58c635b71ebe8a37ee98f6d4cc3022 Mon Sep 17 00:00:00 2001 From: ForestOfLight Date: Sat, 25 Jan 2025 03:11:59 -0800 Subject: [PATCH] Add CI through GitHub Actions --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..349bffa --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +name: CI + +on: + push: + branches: + - '**' + pull_request: + branches: + - '**' + +jobs: + build: + runs-on: windows-latest + + strategy: + matrix: + node-version: [16.x] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + + - name: Install dependencies + run: npm install + + - name: Run tests with coverage + run: npm test + + - name: Upload coverage report + uses: actions/upload-artifact@v3 + with: + name: coverage-report + path: coverage diff --git a/package.json b/package.json index 74e2443..74e302d 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "@vitest/coverage-v8": "^3.0.4" }, "scripts": { - "test": "vitest" + "test": "vitest run --coverage" }, "devDependencies": { "axios": "^1.7.9",