Skip to content

Commit 774eff6

Browse files
committed
fix: CI で JS テストと stylelint を実行する
PR ゲートと main ビルドはいずれも ./gradlew build のみで、JS テスト (npm run test)と stylelint(npm run lint:css)が CI で実行されて いなかった。PR ゲートには Gradle ビルド前に Node セットアップと npm ci + JS テスト + stylelint のステップを追加し、main ビルドには ubuntu で動く js-test ジョブを追加して deploy-pages の前提に加えた。 AGENT: Claude Closes: #1123
1 parent 4217893 commit 774eff6

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

.github/workflows/build-main.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,25 @@ jobs:
3636
path: build/reports/tests/
3737
retention-days: 3
3838

39+
js-test:
40+
# JavaScript のテストはubuntuだけで行う
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v7
44+
- name: Set up Node.js
45+
uses: actions/setup-node@v6
46+
with:
47+
node-version: '24'
48+
cache: 'npm'
49+
- name: Install JS dependencies
50+
run: npm ci
51+
- name: Run JS tests
52+
run: npm run test
53+
- name: Run stylelint
54+
run: npm run lint:css
55+
3956
deploy-pages:
40-
needs: build
57+
needs: [ build, js-test ]
4158
runs-on: ubuntu-latest
4259
permissions:
4360
contents: write

.github/workflows/test-pull-request.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ jobs:
2727
with:
2828
distribution: 'temurin'
2929
java-version: '21'
30+
- name: Set up Node.js
31+
uses: actions/setup-node@v6
32+
with:
33+
node-version: '24'
34+
cache: 'npm'
35+
- name: Install JS dependencies
36+
run: npm ci
37+
- name: Run JS tests
38+
run: npm run test
39+
- name: Run stylelint
40+
run: npm run lint:css
3041
- name: Setup Gradle
3142
uses: gradle/actions/setup-gradle@v6
3243
- name: Build

0 commit comments

Comments
 (0)