From 2212a484261669eb988e8fd92beda5d87c315ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E6=A1=93=E6=A1=93?= Date: Tue, 28 Feb 2023 20:48:49 +0800 Subject: [PATCH] chore(ci): add Lint & Build tests --- .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) 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..3329c1d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,56 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + # Test Lint + lint: + # Use Ubuntu 22.04 + runs-on: ubuntu-22.04 + steps: + # Step I + - name: Get Source Code + uses: actions/checkout@v3 + # Step II + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + # Step IV + - name: Install Dependencies + run: npm ci + # Step V + - name: Lint + run: npm run lint + # Test Build + build: + # Use Ubuntu Linux, Windows and OS X + runs-on: ${{ matrix.os }} + strategy: + matrix: + node-version: [ 16, 18, latest ] + os: [ ubuntu-latest, windows-latest, macos-latest ] + fail-fast: false + steps: + # Step I + - name: Get Source Code + uses: actions/checkout@v3 + # Step II + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + registry-url: https://registry.npmjs.org/ + # Step III + - name: Install Dependencies + run: npm ci + # Step IV + - name: Test Build + run: npm run build