feat(achievement): build ProximityAchievements #10467
Workflow file for this run
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: CI | |
| on: [pull_request] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-22.04 | |
| name: Check for changes | |
| outputs: | |
| php: ${{ steps.filter.outputs.php }} | |
| node: ${{ steps.filter.outputs.node }} | |
| steps: | |
| - name: Check changed files | |
| uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| php: | |
| - '**/*.php' | |
| - 'composer.json' | |
| - 'composer.lock' | |
| - 'phpstan.neon' | |
| - 'pint.json' | |
| node: | |
| - '**/*.js' | |
| - '**/*.ts' | |
| - '**/*.tsx' | |
| - 'package.json' | |
| - 'pnpm-lock.yaml' | |
| - '*eslint*' | |
| - 'tailwind.config.json' | |
| - 'lang/**/*.json' | |
| node-setup: | |
| needs: changes | |
| runs-on: ubuntu-22.04 | |
| name: Node.js Setup | |
| steps: | |
| - name: Checkout code | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Install pnpm | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.17 | |
| - name: Use Node 24 | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| php-checks: | |
| needs: changes | |
| runs-on: ubuntu-22.04 | |
| name: PHP Checks | |
| strategy: | |
| matrix: | |
| check: ['lint', 'analyse'] | |
| include: | |
| - check: lint | |
| command: composer lint | |
| - check: analyse | |
| command: composer analyse -- --memory-limit=1G | |
| env: | |
| # PHPStan explodes if we're missing an APP_KEY. This is a value pulled from the Laravel docs. | |
| APP_KEY: 'base64:J63qRTDLub5NuZvP+kb8YIorGS6qFYHKVo6u7179stY=' | |
| steps: | |
| - name: Skip if no PHP changes | |
| if: ${{ needs.changes.outputs.php != 'true' }} | |
| run: | | |
| echo "No PHP changes detected - skipping ${{ matrix.check }}" | |
| exit 0 | |
| - name: Checkout code | |
| if: ${{ needs.changes.outputs.php == 'true' }} | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup PHP | |
| if: ${{ needs.changes.outputs.php == 'true' }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.4 | |
| extensions: mbstring, :psr | |
| coverage: none | |
| ini-values: memory_limit=1G | |
| - name: Install composer packages | |
| if: ${{ needs.changes.outputs.php == 'true' }} | |
| run: composer install --prefer-dist | |
| - name: Restore PHPStan result cache | |
| if: ${{ needs.changes.outputs.php == 'true' && matrix.check == 'analyse' }} | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: tmp | |
| key: phpstan-result-cache-${{ github.run_id }} | |
| restore-keys: | | |
| phpstan-result-cache- | |
| - name: Run ${{ matrix.check }} | |
| if: ${{ needs.changes.outputs.php == 'true' }} | |
| run: ${{ matrix.command }} | |
| env: ${{ matrix.env || fromJSON('{}') }} | |
| - name: Save PHPStan result cache | |
| if: ${{ needs.changes.outputs.php == 'true' && matrix.check == 'analyse' }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: tmp | |
| key: phpstan-result-cache-${{ github.run_id }} | |
| php-tests: | |
| needs: changes | |
| runs-on: ubuntu-22.04 | |
| name: PHP Checks (test) | |
| strategy: | |
| matrix: | |
| shardIndex: [1, 2, 3, 4, 5] | |
| shardTotal: [5] | |
| steps: | |
| - name: Skip if no PHP changes | |
| if: ${{ needs.changes.outputs.php != 'true' }} | |
| run: | | |
| echo "No PHP changes detected - skipping tests (shard ${{ matrix.shardIndex }})" | |
| exit 0 | |
| - name: Checkout code | |
| if: ${{ needs.changes.outputs.php == 'true' }} | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Setup PHP | |
| if: ${{ needs.changes.outputs.php == 'true' }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.4 | |
| extensions: mbstring, :psr | |
| coverage: none | |
| ini-values: memory_limit=1G | |
| - name: Install composer packages | |
| if: ${{ needs.changes.outputs.php == 'true' }} | |
| run: composer install --prefer-dist | |
| - name: Generate Passport keys | |
| if: ${{ needs.changes.outputs.php == 'true' }} | |
| run: php artisan passport:keys --force | |
| - name: Run tests with sharding | |
| if: ${{ needs.changes.outputs.php == 'true' }} | |
| run: ./vendor/bin/pest --parallel --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} | |
| merge-php-test-reports: | |
| needs: [changes, php-tests] | |
| runs-on: ubuntu-22.04 | |
| name: Merge PHP Test Reports | |
| if: ${{ always() }} | |
| steps: | |
| - name: Check PHP test status | |
| run: | | |
| if [[ "${{ needs.changes.outputs.php }}" != "true" ]]; then | |
| echo "No PHP changes - skipping" | |
| exit 0 | |
| fi | |
| if [[ "${{ needs.php-tests.result }}" != "success" ]]; then | |
| echo "php-tests failed" | |
| exit 1 | |
| fi | |
| echo "All PHP tests passed" | |
| node-checks: | |
| needs: [changes, node-setup] | |
| runs-on: ubuntu-22.04 | |
| name: Node.js Checks | |
| strategy: | |
| matrix: | |
| check: ['tsc', 'lint'] | |
| include: | |
| - check: tsc | |
| command: pnpm tsc | |
| - check: lint | |
| command: pnpm lint | |
| steps: | |
| - name: Skip if no Node changes | |
| if: ${{ needs.changes.outputs.node != 'true' }} | |
| run: | | |
| echo "No Node changes detected - skipping ${{ matrix.check }}" | |
| exit 0 | |
| - name: Checkout code | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Install pnpm | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.17 | |
| - name: Use Node 24 | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| - name: Install dependencies | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| run: pnpm install --frozen-lockfile --prefer-offline | |
| - name: Setup PHP | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.4 | |
| extensions: mbstring | |
| coverage: none | |
| - name: Install composer packages | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| run: composer install --prefer-dist --no-progress | |
| - name: Generate Ziggy routes | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| run: php artisan ziggy:generate --types | |
| - name: Run ${{ matrix.check }} | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| run: ${{ matrix.command }} | |
| env: ${{ matrix.env || fromJSON('{}') }} | |
| node-tests: | |
| needs: [changes, node-setup] | |
| runs-on: ubuntu-22.04 | |
| name: Node.js Checks (test) | |
| strategy: | |
| matrix: | |
| shardIndex: [1, 2, 3, 4, 5, 6, 7] | |
| shardTotal: [7] | |
| steps: | |
| - name: Skip if no Node changes | |
| if: ${{ needs.changes.outputs.node != 'true' }} | |
| run: | | |
| echo "No Node changes detected - skipping tests (shard ${{ matrix.shardIndex }})" | |
| exit 0 | |
| - name: Checkout code | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Install pnpm | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.17 | |
| - name: Use Node 24 | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| - name: Install dependencies | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| run: pnpm install --frozen-lockfile --prefer-offline | |
| - name: Setup PHP | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.4 | |
| extensions: mbstring | |
| coverage: none | |
| - name: Install composer packages | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| run: composer install --prefer-dist --no-progress | |
| - name: Generate Ziggy routes | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| run: php artisan ziggy:generate --types | |
| - name: Run tests with sharding | |
| if: ${{ needs.changes.outputs.node == 'true' }} | |
| run: pnpm test:run --coverage --coverage.thresholds=false --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} | |
| env: | |
| VITE_BUILD_PATH: dist | |
| APP_URL: https://raweb.test | |
| LARAVEL_BYPASS_ENV_CHECK: 1 | |
| - name: Upload blob report | |
| if: ${{ needs.changes.outputs.node == 'true' && !cancelled() }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: blob-report-${{ matrix.shardIndex }} | |
| path: .vitest-reports/* | |
| include-hidden-files: true | |
| retention-days: 1 | |
| merge-test-reports: | |
| needs: [changes, node-tests] | |
| runs-on: ubuntu-22.04 | |
| name: Merge Node.js Test Reports | |
| # Only run if there are Node.js changes AND any of the test jobs were successful. | |
| if: ${{ needs.changes.outputs.node == 'true' && !cancelled() }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.17 | |
| - name: Use Node 24 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile --prefer-offline | |
| - name: Download blob reports | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: .vitest-reports | |
| pattern: blob-report-* | |
| merge-multiple: true | |
| - name: Merge reports | |
| run: pnpm test:run --merge-reports --coverage --coverage.reporters=text | |
| env: | |
| VITE_BUILD_PATH: dist | |
| APP_URL: https://raweb.test | |
| LARAVEL_BYPASS_ENV_CHECK: 1 |