update CI #4
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: HHVM CI | |
| on: | |
| push: | |
| branches: [main, develop] | |
| pull_request: | |
| jobs: | |
| hhvm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # 🧠 Cache dependencies (Composer + Hack) | |
| - name: Cache Composer dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| vendor | |
| ~/.composer/cache | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-composer- | |
| - name: Setup HHVM | |
| uses: azjezz/setup-hhvm@v1 | |
| with: | |
| version: latest | |
| debug: false | |
| - name: Verify HHVM | |
| run: hhvm --version | |
| # 📦 Install Composer (already handled, but ensure deps) | |
| - name: Install dependencies | |
| run: composer install --no-interaction --prefer-dist --optimize-autoloader | |
| # 🧪 Hack Typechecking | |
| - name: Run Hack Typecheck | |
| run: | | |
| hh_client || (echo "Typecheck failed" && exit 1) | |
| # 🧹 Hack Formatting Check | |
| - name: Check formatting (hackfmt) | |
| run: | | |
| if ! command -v hackfmt &> /dev/null; then | |
| echo "hackfmt not found" | |
| exit 1 | |
| fi | |
| hackfmt --test . | |
| # 🔍 Linting with HHAST (if installed) | |
| - name: Run HHAST Lint | |
| run: | | |
| if [ -f vendor/bin/hhast-lint ]; then | |
| vendor/bin/hhast-lint | |
| else | |
| echo "HHAST not installed, skipping" | |
| fi | |
| # 🧪 Optional: Run PHPUnit (if PHP interop) | |
| - name: Run tests | |
| run: | | |
| if [ -f vendor/bin/phpunit ]; then | |
| vendor/bin/phpunit --testdox | |
| else | |
| echo "PHPUnit not installed, skipping" | |
| fi |