異體字落地替換第三階段 work plan:按欄位型別全面套用 #2465
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: PHPUnit Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| - feature/** | |
| - claude/** | |
| - fix/** | |
| pull_request: | |
| branches: | |
| - main | |
| - develop | |
| permissions: | |
| contents: read | |
| jobs: | |
| feature-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Set up PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| extensions: mbstring, xml, ctype, iconv, curl, pdo_sqlite | |
| coverage: none | |
| # PHP 8.4 經測試可正常運行,建議使用以獲得最佳性能 | |
| - name: Get Composer cache directory | |
| id: composer-cache | |
| run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@v6 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: ${{ runner.os }}-composer- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-progress --no-interaction | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '22' | |
| - name: Get npm cache directory | |
| id: npm-cache | |
| run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT | |
| - name: Cache npm dependencies | |
| uses: actions/cache@v6 | |
| with: | |
| path: ${{ steps.npm-cache.outputs.dir }} | |
| key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: ${{ runner.os }}-npm- | |
| - name: Build frontend assets | |
| run: | | |
| npm install | |
| npm run prod | |
| - name: Run frontend unit tests (vitest) | |
| run: npm run test | |
| - name: Display versions | |
| run: | | |
| php -v | |
| composer --version | |
| ./vendor/bin/phpunit --version | |
| - name: Prepare environment | |
| run: | | |
| cp .env.example .env | |
| php artisan key:generate | |
| - name: Run PHPUnit suite | |
| run: ./vendor/bin/phpunit |