diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..e069a39 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,40 @@ +name: PHP Tests + +on: [ push, pull_request ] + +jobs: + + build: + strategy: + matrix: + operating-system: [ ubuntu-latest ] + php-versions: [ '7.3', '7.4', '8.0', '8.1' ] + experimental: [ false ] + include: + - php-versions: '8.2' + operating-system: ubuntu-latest + experimental: true + fail-fast: false + runs-on: ${{ matrix.operating-system }} + continue-on-error: ${{ matrix.experimental }} + steps: + - uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + + - name: Validate composer.json and composer.lock + run: composer validate + + - name: Install dependencies + if: "${{ matrix.experimental == false }}" + run: composer install --prefer-dist --no-progress --no-suggest + + - name: Install dependencies, ignore php requirements + if: "${{ matrix.experimental == true }}" + run: composer install --prefer-dist --no-progress --no-suggest --ignore-platform-reqs + + - name: Run test suite + run: composer run-script test diff --git a/.gitignore b/.gitignore index e48cc98..e74ce5f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,8 @@ .tmp pkg tmp + +.phpunit.result.cache +composer.lock +.idea/ +vendor/ diff --git a/composer.json b/composer.json index f1e477a..de577a4 100644 --- a/composer.json +++ b/composer.json @@ -13,16 +13,23 @@ } ], "require": { - "php": "^5.6 || ^7.0 || ^8.0", + "php": "^7.3 || ^8.0", "phpseclib/phpseclib": "^2.0.31" }, "require-dev": { + "roave/security-advisories": "dev-latest", "phpunit/phpunit": "^9.0" }, "suggest": { - "ext-mcrypt": "required if you use encryption cast5" + "ext-mcrypt": "required if you use encryption cast5", + "ext-sodium": "required if you use signature ed25519" }, "autoload": { - "classmap": ["lib/"] + "classmap": [ + "lib/" + ] + }, + "scripts": { + "test": "./vendor/bin/phpunit" } }