fix: プレビューを正しく表示できるようにする #2065
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: common | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| permissions: | |
| contents: read | |
| actions: read | |
| jobs: | |
| dependencies: | |
| name: Prepare packages and Generate apis | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| actions: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ./.node-version | |
| cache: npm | |
| - run: npm ci | |
| - uses: actions/upload-artifact@v5 | |
| with: | |
| name: apis | |
| path: ./src/lib/apis/generated | |
| type-check: | |
| name: Type Check | |
| runs-on: ubuntu-latest | |
| needs: [dependencies] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ./.node-version | |
| cache: npm | |
| - run: npm ci | |
| - uses: actions/download-artifact@v6 | |
| with: | |
| name: apis | |
| path: ./src/lib/apis/generated | |
| - run: npm run type-check | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| needs: [dependencies] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ./.node-version | |
| cache: npm | |
| - run: npm ci | |
| - uses: actions/download-artifact@v6 | |
| with: | |
| name: apis | |
| path: ./src/lib/apis/generated | |
| - run: npm run lint:nofix -- --max-warnings=0 | |
| format: | |
| name: Format | |
| runs-on: ubuntu-latest | |
| needs: [dependencies] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ./.node-version | |
| cache: npm | |
| - run: npm ci | |
| - uses: actions/download-artifact@v6 | |
| with: | |
| name: apis | |
| path: ./src/lib/apis/generated | |
| - run: npm run format:check | |
| genApi: | |
| name: Generate APIs | |
| runs-on: ubuntu-latest | |
| needs: [dependencies] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ./.node-version | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run gen-api | |
| - name: Check for differences in generated APIs | |
| run: | | |
| git diff --exit-code ./src/lib/apis/generated || { | |
| echo "Generated APIs are outdated or modified. Please run 'npm run gen-api' and commit the changes." | |
| exit 1 | |
| } | |
| check-msw: | |
| name: Check MSW | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ./.node-version | |
| cache: npm | |
| - run: npm ci | |
| - run: npx msw init | |
| - name: Check for differences in msw worker | |
| run: | | |
| git diff --exit-code public/mockServiceWorker.js || { | |
| echo "public/mockServiceWorker.js is outdated. Please run 'npx msw init' and commit the changes." | |
| exit 1 | |
| } | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: [dependencies] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: ./.node-version | |
| cache: npm | |
| - run: npm ci | |
| - uses: actions/download-artifact@v6 | |
| with: | |
| name: apis | |
| path: ./src/lib/apis/generated | |
| - run: npm run build |