From 7b187a4fd250e394ca4c278757896ad8251a67bf Mon Sep 17 00:00:00 2001 From: LokiSharp Date: Sun, 15 Oct 2023 02:53:23 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E6=B7=BB=E5=8A=A0=20Github=20Action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 1 + .github/workflows/main.yml | 28 ++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .gitattributes create mode 100644 .github/workflows/main.yml diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..94f480d --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..e6bf9a7 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,28 @@ +name: CI + +on: + push: + branches: ["master", "dev", "releases/**"] + pull_request: + branches: ["master"] + +jobs: + build: + strategy: + matrix: + os: [windows-latest, ubuntu-latest, macos-latest] + node-version: [16.x, 18.x, 20.x, latest] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + - 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 lint + - run: npm run build + - run: npm run test \ No newline at end of file diff --git a/package.json b/package.json index 51ebaf0..2dfeab0 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "scripts": { "test": "npm run test --workspaces", - "bulid": "npm run build --workspaces", + "build": "npm run build --workspaces", "lint": "npm run lint --workspaces" }, "repository": {