feat(laravel): go-to-definition for view, route, and translation keys #778
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: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: build | |
| - name: Install mold linker | |
| run: sudo apt-get install -y mold | |
| - name: Configure mold | |
| run: | | |
| mkdir -p .cargo | |
| echo '[target.x86_64-unknown-linux-gnu]' >> .cargo/config.toml | |
| echo 'rustflags = ["-C", "link-arg=-fuse-ld=mold"]' >> .cargo/config.toml | |
| - run: cargo fmt --check | |
| - run: cargo clippy -- -D warnings | |
| - run: cargo clippy --tests -- -D warnings | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: coverage | |
| - name: Install mold linker | |
| run: sudo apt-get install -y mold | |
| - name: Configure mold | |
| run: | | |
| mkdir -p .cargo | |
| echo '[target.x86_64-unknown-linux-gnu]' >> .cargo/config.toml | |
| echo 'rustflags = ["-C", "link-arg=-fuse-ld=mold"]' >> .cargo/config.toml | |
| - name: Install cargo-llvm-cov and cargo-nextest | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-llvm-cov,cargo-nextest | |
| - name: Run tests with coverage | |
| run: cargo llvm-cov nextest --lcov --output-path lcov.info | |
| - name: Upload to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: lcov.info | |
| fail_ci_if_error: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| php-lint: | |
| name: PHP Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: "8.4" | |
| ini-values: zend.assertions=1 | |
| - run: php -l example.php | |
| - run: php -d zend.assertions=1 example.php | |
| benchmark: | |
| name: Benchmark | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: build | |
| - name: Ensure gh-pages branch exists | |
| run: | | |
| if ! git ls-remote --exit-code --heads origin gh-pages > /dev/null 2>&1; then | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| empty_tree="$(git hash-object -t tree /dev/null)" | |
| commit="$(git commit-tree "$empty_tree" -m 'Initial gh-pages branch')" | |
| git push origin "$commit:refs/heads/gh-pages" | |
| fi | |
| - name: Run benchmarks | |
| run: cargo bench --bench completion -- --output-format bencher | tee raw_output.txt | |
| - name: Convert to milliseconds | |
| run: python3 benches/format_bench_output.py < raw_output.txt > output.json | |
| - name: Store benchmark result | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| name: PHPantom Benchmarks | |
| tool: customSmallerIsBetter | |
| output-file-path: output.json | |
| gh-pages-branch: gh-pages | |
| benchmark-data-dir-path: dev/bench | |
| auto-push: true | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| benchmark-pr: | |
| name: Benchmark (PR comparison) | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: build | |
| - name: Check gh-pages branch exists | |
| id: check-gh-pages | |
| run: | | |
| if git ls-remote --exit-code --heads origin gh-pages > /dev/null 2>&1; then | |
| echo "exists=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "exists=false" >> "$GITHUB_OUTPUT" | |
| echo "⚠️ gh-pages branch does not exist yet — skipping PR benchmark comparison" | |
| fi | |
| - name: Run benchmarks | |
| if: steps.check-gh-pages.outputs.exists == 'true' | |
| run: cargo bench --bench completion -- --output-format bencher | tee raw_output.txt | |
| - name: Convert to milliseconds | |
| if: steps.check-gh-pages.outputs.exists == 'true' | |
| run: python3 benches/format_bench_output.py < raw_output.txt > output.json | |
| - name: Compare against baseline | |
| if: steps.check-gh-pages.outputs.exists == 'true' | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| name: PHPantom Benchmarks | |
| tool: customSmallerIsBetter | |
| output-file-path: output.json | |
| gh-pages-branch: gh-pages | |
| benchmark-data-dir-path: dev/bench | |
| auto-push: false | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| comment-on-alert: true | |
| alert-threshold: "130%" | |
| fail-on-alert: true | |
| alert-comment-cc-users: "@AJenbo" | |
| memory-benchmark: | |
| name: Memory Benchmark | |
| runs-on: ubuntu-latest | |
| needs: benchmark | |
| permissions: | |
| contents: write | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: build | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: "8.4" | |
| tools: composer | |
| - name: Install mold linker | |
| run: sudo apt-get install -y mold | |
| - name: Configure mold | |
| run: | | |
| mkdir -p .cargo | |
| echo '[target.x86_64-unknown-linux-gnu]' >> .cargo/config.toml | |
| echo 'rustflags = ["-C", "link-arg=-fuse-ld=mold"]' >> .cargo/config.toml | |
| - name: Build release binary | |
| run: cargo build --release | |
| - name: Measure memory usage | |
| run: python3 benches/memory_usage.py --binary target/release/phpantom_lsp | tee memory_output.json | |
| - name: Store memory benchmark result | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| name: PHPantom Memory Usage | |
| tool: customSmallerIsBetter | |
| output-file-path: memory_output.json | |
| gh-pages-branch: gh-pages | |
| benchmark-data-dir-path: dev/memory | |
| auto-push: true | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| memory-benchmark-pr: | |
| name: Memory Benchmark (PR comparison) | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: build | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: "8.4" | |
| tools: composer | |
| - name: Install mold linker | |
| run: sudo apt-get install -y mold | |
| - name: Configure mold | |
| run: | | |
| mkdir -p .cargo | |
| echo '[target.x86_64-unknown-linux-gnu]' >> .cargo/config.toml | |
| echo 'rustflags = ["-C", "link-arg=-fuse-ld=mold"]' >> .cargo/config.toml | |
| - name: Build release binary | |
| run: cargo build --release | |
| - name: Check gh-pages branch exists | |
| id: check-gh-pages | |
| run: | | |
| if git ls-remote --exit-code --heads origin gh-pages > /dev/null 2>&1; then | |
| echo "exists=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "exists=false" >> "$GITHUB_OUTPUT" | |
| echo "⚠️ gh-pages branch does not exist yet — skipping memory benchmark comparison" | |
| fi | |
| - name: Measure memory usage | |
| if: steps.check-gh-pages.outputs.exists == 'true' | |
| run: python3 benches/memory_usage.py --binary target/release/phpantom_lsp | tee memory_output.json | |
| - name: Compare against baseline | |
| if: steps.check-gh-pages.outputs.exists == 'true' | |
| uses: benchmark-action/github-action-benchmark@v1 | |
| with: | |
| name: PHPantom Memory Usage | |
| tool: customSmallerIsBetter | |
| output-file-path: memory_output.json | |
| gh-pages-branch: gh-pages | |
| benchmark-data-dir-path: dev/memory | |
| auto-push: false | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| comment-on-alert: true | |
| alert-threshold: "130%" | |
| fail-on-alert: true | |
| alert-comment-cc-users: "@AJenbo" |