chore(deps): update github artifact actions #8459
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: unit-test | |
| on: | |
| - push | |
| env: | |
| NEXT_PUBLIC_FIREBASE_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_FIREBASE_PROJECT_ID }} | |
| NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN: ${{ secrets.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN }} | |
| NEXT_PUBLIC_FIREBASE_API_KEY: ${{ secrets.NEXT_PUBLIC_FIREBASE_API_KEY }} | |
| NEXT_PUBLIC_GTM_ID: ${{ secrets.NEXT_PUBLIC_GTM_ID }} | |
| jobs: | |
| unit-test: | |
| runs-on: ubuntu-latest | |
| environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'preview' }} | |
| strategy: | |
| matrix: | |
| shard: [1/3, 2/3, 3/3] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Record setup start | |
| run: echo "SETUP_START=$(date +%s)" >> $GITHUB_ENV | |
| - name: Setup | |
| uses: ./.github/actions/setup | |
| - name: Measure setup time | |
| run: | | |
| SETUP_END=$(date +%s) | |
| SETUP_TIME=$((SETUP_END - SETUP_START)) | |
| echo "⚡ Unit Test Setup Time: ${SETUP_TIME}s" >> $GITHUB_STEP_SUMMARY | |
| - name: Cache Vitest | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| node_modules/.vitest | |
| .vitest | |
| key: ${{ runner.os }}-vitest-${{ hashFiles('vitest.config.mts', 'src/**/*.{test,spec}.{ts,tsx}') }} | |
| restore-keys: | | |
| ${{ runner.os }}-vitest- | |
| - name: Record test start | |
| run: echo "TEST_START=$(date +%s)" >> $GITHUB_ENV | |
| - name: Run Test | |
| run: pnpm vitest run --shard=${{ matrix.shard }} | |
| - name: Measure test time | |
| run: | | |
| TEST_END=$(date +%s) | |
| TEST_TIME=$((TEST_END - TEST_START)) | |
| echo "🧪 Unit Test (shard ${{ matrix.shard }}) Time: ${TEST_TIME}s" >> $GITHUB_STEP_SUMMARY | |
| if [ "$TEST_TIME" -lt 60 ]; then | |
| echo "🎯 高速テスト実行: キャッシュ効果良好!" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "🔄 テスト実行: 通常時間" >> $GITHUB_STEP_SUMMARY | |
| fi |