From 91838194bbc2a9549ebe6e596464e149f0753f21 Mon Sep 17 00:00:00 2001 From: sudoooooo Date: Fri, 17 May 2024 11:19:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0lint=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E5=92=8C=E8=A6=86=E7=9B=96=E7=8E=87=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/codecov.yml | 39 +++++++++++++++++++++++++++++++ .github/workflows/server-lint.yml | 34 +++++++++++++++++++++++++++ .github/workflows/web-lint.yml | 34 +++++++++++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 .github/workflows/codecov.yml create mode 100644 .github/workflows/server-lint.yml create mode 100644 .github/workflows/web-lint.yml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 00000000..5ea69f33 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,39 @@ +# Unit Test Coverage Report +name: Test Coverage + +on: + pull_request: + branches: + - feature/workflow + - develop + - main + - releases/** + - feature/** + paths: + - server/** + workflow_dispatch: + +jobs: + build: + name: Coverage + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install dependencies + run: cd server && npm install + + - name: Run tests and collect coverage + run: cd server && npm run test:cov + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/server-lint.yml b/.github/workflows/server-lint.yml new file mode 100644 index 00000000..dec0c544 --- /dev/null +++ b/.github/workflows/server-lint.yml @@ -0,0 +1,34 @@ +# Lint +name: Server Lint + +on: + pull_request: + branches: + - feature/workflow + - develop + - main + - releases/** + - feature/** + paths: + - server/** + workflow_dispatch: + +jobs: + build: + name: Lint + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install dependencies + run: cd server && npm install + + - name: Lint + run: cd server && npm run lint diff --git a/.github/workflows/web-lint.yml b/.github/workflows/web-lint.yml new file mode 100644 index 00000000..f0963789 --- /dev/null +++ b/.github/workflows/web-lint.yml @@ -0,0 +1,34 @@ +# Lint +name: Web Lint + +on: + pull_request: + branches: + - feature/workflow + - develop + - main + - releases/** + - feature/** + paths: + - web/** + workflow_dispatch: + +jobs: + build: + name: Lint + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install dependencies + run: cd web && npm install + + - name: Lint + run: cd web && npm run lint