From ea89e0498eae3c8be6d564c4bc99564ae5a3e6e5 Mon Sep 17 00:00:00 2001 From: "Brian,Kun Liu" Date: Thu, 19 Jun 2025 11:31:07 +0800 Subject: [PATCH] ci: add build and check on PR before merged --- .github/workflows/check.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..8afafe4 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,30 @@ +name: check + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + format-and-build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + + - name: Install dependencies + run: npm ci + + - name: Format check + run: npm run format.check + + - name: Build + run: npm run build