Skip to content

Commit

Permalink
Merge pull request #16 from kei-s16/feature/run-next-lint
Browse files Browse the repository at this point in the history
lintをciで動かす
  • Loading branch information
kei-s16 authored Jul 20, 2023
2 parents a7ba66e + e7eb447 commit 14ef5f0
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 3 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "next lintをかける"

on:
pull_request:
paths:
- "**/*.ts"
- "**/*.tsx"

jobs:
nextlint:
runs-on: ubuntu-latest
steps:
- name: "checkoutする"
uses: actions/checkout@v3

- name: "Node.jsのセットアップ"
uses: actions/setup-node@v3
with:
node-version: 20
- name: "pnpmのセットアップ"
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 8
run_install: false
- name: "reviewdogのインストール"
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest

- name: "pnpmのパッケージ保存先を保持"
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: "キャッシュを使う"
uses: actions/cache@v3
id: pnpm-cache-node_modules
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: "パッケージのインストール"
run: pnpm install

- name: "next lintの実行 with reviewdog"
run: |
pnpm run lint -f checkstyle | reviewdog -f checkstyle --name=nextlint -reporter=github-pr-review
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}

3 changes: 1 addition & 2 deletions .github/workflows/textlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: "checkoutする"
uses: actions/checkout@v3
with:
fetch-depth: 2
fetch-depth: 0
- name: "fetchする"
run: git fetch

Expand Down Expand Up @@ -43,7 +43,6 @@ jobs:
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-node_modules-
- name: "パッケージのインストール"
run: pnpm install

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"lint": "eslint -f stylish ./modules ./app",
"format": "prettier --write --ignore-path .gitignore './**/*.{js,jsx,ts,tsx,json}'"
},
"keywords": [],
Expand Down

0 comments on commit 14ef5f0

Please sign in to comment.