feat: PHPUnit を使わずにPHP5.4~8.0のテストをサポート #22
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 Legacy PHP | |
| on: [push, pull_request] | |
| permissions: | |
| contents: read | |
| jobs: | |
| tests-legacy: | |
| name: Tests PHP ${{ matrix.php-version }} | |
| timeout-minutes: 10 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: bcmath | |
| tools: composer:v1 # Use Composer v1 for better PHP 5.x compatibility | |
| - name: Install dependencies | |
| run: | | |
| # Remove dev dependencies first to avoid conflicts | |
| composer remove phpunit/phpunit squizlabs/php_codesniffer --dev --no-update | |
| # Force phpseclib 2.x for older PHP versions (fetch from GitHub for Composer v1 EOL workaround) | |
| if [[ "${{ matrix.php-version }}" < "7.2" ]]; then | |
| # Use GitHub token to avoid rate limiting and authentication issues | |
| composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }} | |
| # Use HTTPS URL with token authentication | |
| composer config repositories.phpseclib vcs https://oauth2:${{ secrets.GITHUB_TOKEN }}@github.com/phpseclib/phpseclib.git | |
| composer require phpseclib/phpseclib:^2.0 --no-update | |
| fi | |
| composer install --no-interaction --prefer-dist --no-dev | |
| - name: Run tests with simple test runner | |
| run: php tests/simple-test-runner.php | |
| - name: Show PHP version | |
| run: php -v | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-version: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] |