[UPD] [REF] v3.0.0 release preparation #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: Tests | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| unit: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: [ '8.2', '8.3', '8.4', '8.5' ] | |
| name: Unit — PHP ${{ matrix.php-version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup PHP ${{ matrix.php-version }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: openssl, sockets, pcntl | |
| coverage: ${{ matrix.php-version == '8.5' && 'xdebug' || 'none' }} | |
| - name: Install Composer dependencies | |
| run: composer install --no-interaction --prefer-dist | |
| - name: Run unit tests | |
| run: vendor/bin/pest tests/Unit ${{ matrix.php-version == '8.5' && '--coverage-clover=coverage/unit-clover.xml' || '' }} | |
| - name: Upload unit coverage to Codecov | |
| if: matrix.php-version == '8.5' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: coverage/unit-clover.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: unit | |
| fail_ci_if_error: false | |
| integration: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: [ '8.2', '8.3', '8.4', '8.5' ] | |
| name: Integration — PHP ${{ matrix.php-version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup PHP ${{ matrix.php-version }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: openssl, sockets, pcntl | |
| coverage: ${{ matrix.php-version == '8.5' && 'xdebug' || 'none' }} | |
| - name: Install Composer dependencies | |
| run: composer install --no-interaction --prefer-dist | |
| - name: Start OPC UA test servers | |
| id: opcua | |
| uses: GianfriAur/opcua-test-server-suite@v1.1.4 | |
| - name: Run all tests | |
| env: | |
| OPCUA_CERTS_DIR: ${{ steps.opcua.outputs.certs-dir }} | |
| run: vendor/bin/pest --log-junit=results/junit.xml ${{ matrix.php-version == '8.5' && '--coverage-clover=coverage/clover.xml' || '' }} | |
| - name: Upload coverage to Codecov | |
| if: matrix.php-version == '8.5' | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: coverage/clover.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| fail_ci_if_error: false | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| files: results/junit.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| flags: test-results | |
| disable_search: true | |
| - name: Server logs (on failure) | |
| if: failure() | |
| working-directory: .opcua-test-server-suite | |
| run: docker compose logs --tail=100 |