From 297cca18467c227a24c920d419eabe7e8e38d13f Mon Sep 17 00:00:00 2001 From: Kazuki Yamada Date: Fri, 11 Oct 2024 13:56:16 +0900 Subject: [PATCH] =?UTF-8?q?ci(lint):=20CI=E3=81=AE=E5=90=84lint=E3=82=92?= =?UTF-8?q?=E5=88=A5=E3=81=AEjob=E3=81=AB=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 75 +++++++++++++++++++++++----------------- package.json | 5 ++- 2 files changed, 48 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99d2b1434dcd..f826da92ba41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,66 +12,79 @@ on: workflow_dispatch: jobs: - lint: + lint-biome: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: - - name: Checkout code - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .tool-versions + cache: yarn + - run: yarn install + - run: yarn lint-biome && git diff --exit-code - - name: Setup node - uses: actions/setup-node@v4 + lint-ts: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version-file: .tool-versions cache: yarn + - run: yarn install + - run: yarn lint-ts - - name: Install dependencies - run: yarn install + lint-secretlint: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .tool-versions + cache: yarn + - run: yarn install + - run: yarn lint-secretlint - - name: Lint - run: yarn lint && git diff --exit-code + validate-renovate-config: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: .tool-versions + - name: Validate Renovate config + run: npx --yes --package renovate -- renovate-config-validator --strict test: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version-file: .tool-versions cache: yarn - - - name: Install dependencies - run: yarn install - - - name: Test - run: yarn test-coverage + - run: yarn install + - run: yarn test-coverage generate: runs-on: ubuntu-24.04 timeout-minutes: 20 steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version-file: .tool-versions cache: yarn - - - name: Install dependencies - run: yarn install - + - run: yarn install - name: Generate feed run: yarn feed-generate - - name: Generate site run: yarn site-build - - name: Archive feed uses: actions/upload-artifact@v4 with: diff --git a/package.json b/package.json index 461b4b176ce6..a74e75db8ac0 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,10 @@ "register-index": "tsx src/feed/register-index-command.ts", "site-build": "tsx ./node_modules/.bin/eleventy --config=eleventy.config.ts", "site-serve": "tsx ./node_modules/.bin/eleventy --config=eleventy.config.ts --serve", - "lint": "biome check --write && tsc --noEmit && secretlint '**/*'", + "lint": "yarn lint-biome && yarn lint-ts && yarn lint-secretlint", + "lint-biome": "biome check --write", + "lint-ts": "tsc --noEmit", + "lint-secretlint": "secretlint '**/*'", "test": "vitest run", "test-coverage": "vitest run --coverage", "renovate-validate": "renovate-config-validator"