phpseclib/.github/workflows/ci.yml
terrafrost 826b4cb582 don't run unit tests on PHP 5.6
phpseclib 3.0 still nominally supports PHP 5.6 but i'm tired of seeing
unit tests fail because of issues i can't reproduce on my own local
PHP 5.6 install.

this isn't without precident.phpseclib 1.0 nominally supports PHP 4.4,
as well, but it's not unit tested on PHP 4.4. for that one, if someone
has an issue with PHP 4.4 they're free to report it on github. PHP 5.6
will henceforth work that way for phpseclib 3.0.
2024-09-24 22:21:02 -05:00

96 lines
4.5 KiB
YAML

name: CI
on: [push, pull_request]
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
lint:
name: Lint
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: php-parallel-lint/php-parallel-lint:1
- name: Lint
run: parallel-lint --show-deprecated build phpseclib tests
strategy:
fail-fast: false
matrix:
php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
quality_tools:
name: Quality Tools
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
tools: squizlabs/php_codesniffer:3, friendsofphp/php-cs-fixer:3, vimeo/psalm:4
- name: Composer Install
run: composer install --classmap-authoritative --no-interaction --no-cache
- name: PHP_CodeSniffer
run: phpcs --standard=build/php_codesniffer.xml
- name: PHP CS Fixer
run: php-cs-fixer fix --config=build/php-cs-fixer.php --diff --dry-run --using-cache=no
- name: Psalm
run: psalm --config=build/psalm.xml --no-cache --long-progress --report-show-info=false
tests:
name: Tests
timeout-minutes: 10
# Sometimes there is a segfault on PHP 5.6.
continue-on-error: ${{ matrix.php-version == '5.6' }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Composer Install
run: composer install --classmap-authoritative --no-interaction --no-cache
- name: Make Tests Compatiable With PHPUnit 7+
if: matrix.php-version != '5.6' && matrix.php-version != '7.0'
run: php tests/make_compatible_with_phpunit7.php
- name: Make Tests Compatiable With PHPUnit 9+
if: matrix.php-version != '5.6' && matrix.php-version != '7.0' && matrix.php-version != '7.1' && matrix.php-version != '7.2'
run: php tests/make_compatible_with_phpunit9.php
- name: Setup Secure Shell Functional Tests
if: matrix.os == 'ubuntu-latest'
run: |
PHPSECLIB_SSH_USERNAME='phpseclib'
PHPSECLIB_SSH_PASSWORD='EePoov8po1aethu2kied1ne0'
sudo useradd --create-home --base-dir /home "$PHPSECLIB_SSH_USERNAME"
echo "$PHPSECLIB_SSH_USERNAME:$PHPSECLIB_SSH_PASSWORD" | sudo chpasswd
ssh-keygen -t rsa -b 1024 -f "$HOME/.ssh/id_rsa" -q -N ""
eval `ssh-agent -s`
ssh-add "$HOME/.ssh/id_rsa"
sudo mkdir -p "/home/$PHPSECLIB_SSH_USERNAME/.ssh/"
sudo cp "$HOME/.ssh/id_rsa.pub" "/home/$PHPSECLIB_SSH_USERNAME/.ssh/authorized_keys"
sudo ssh-keyscan -t rsa localhost > "/tmp/known_hosts"
sudo cp "/tmp/known_hosts" "/home/$PHPSECLIB_SSH_USERNAME/.ssh/known_hosts"
sudo chown "$PHPSECLIB_SSH_USERNAME:$PHPSECLIB_SSH_USERNAME" "/home/$PHPSECLIB_SSH_USERNAME/.ssh/" -R
echo "PHPSECLIB_SSH_HOSTNAME=localhost" >> $GITHUB_ENV
echo "PHPSECLIB_SSH_USERNAME=$PHPSECLIB_SSH_USERNAME" >> $GITHUB_ENV
echo "PHPSECLIB_SSH_PASSWORD=$PHPSECLIB_SSH_PASSWORD" >> $GITHUB_ENV
echo "PHPSECLIB_SSH_HOME=/home/phpseclib" >> $GITHUB_ENV
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
- name: PHPUnit
run: vendor/bin/phpunit --configuration tests/phpunit.xml
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
php-version: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']