Skip to content

ci(legacy): add GitHub token to avoid rate limiting in Composer confi… #15

ci(legacy): add GitHub token to avoid rate limiting in Composer confi…

ci(legacy): add GitHub token to avoid rate limiting in Composer confi… #15

Workflow file for this run

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: |
# 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
composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
composer config repositories.phpseclib vcs https://github.com/phpseclib/phpseclib.git
composer require phpseclib/phpseclib:^2.0 --no-update
fi
composer install --no-interaction --no-cache --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']