Resolve middlewares per context and run the matrix on PHP 8.4 and 8.5 #2
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 | |
| # The harness's own self-test, on PHP 8.4 and 8.5. The committed composer.json declares no | |
| # repositories and requires the middlewares at @dev, so this resolves them from Packagist. It turns | |
| # green once the middleware changes the harness exercises are released to their main branches. | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| self-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['8.4', '8.5'] | |
| name: PHP ${{ matrix.php }} | |
| steps: | |
| - name: Checkout harness | |
| uses: actions/checkout@v7 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: dom, openssl, intl, gmp, bcmath | |
| coverage: none | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| - name: Cache Maven repository | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.m2 | |
| key: ${{ runner.os }}-m2-${{ hashFiles('oracle/pom.xml') }} | |
| restore-keys: ${{ runner.os }}-m2- | |
| - name: Build oracle jar | |
| run: mvn -B -f oracle/pom.xml -DskipTests package | |
| - name: Build oracle image | |
| run: docker build -t java-interop-oracle . | |
| - name: Generate certs | |
| run: bash certs/generate.sh | |
| - name: Start oracle | |
| run: | | |
| docker run -d --name oracle -p 8080:8080 \ | |
| -v "$PWD/certs:/certs" java-interop-oracle | |
| for i in $(seq 1 30); do | |
| if curl -fsS http://127.0.0.1:8080/health >/dev/null 2>&1; then | |
| echo "oracle healthy"; exit 0 | |
| fi | |
| sleep 1 | |
| done | |
| echo "oracle failed to become healthy"; docker logs oracle; exit 1 | |
| - name: Install dependencies | |
| run: composer install --no-interaction --no-progress | |
| - name: Run interop tests | |
| run: vendor/bin/phpunit | |
| - name: Oracle logs (on failure) | |
| if: failure() | |
| run: docker logs oracle || true |