Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add github actions to run tests #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
.tmp
pkg
tmp

.phpunit.result.cache
composer.lock
.idea/
vendor/
13 changes: 10 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}