github ci

This commit is contained in:
Robin Appelman 2021-03-02 17:58:35 +01:00
commit 80a4edf0ef
9 changed files with 144 additions and 6 deletions

70
.github/workflows/ci.yaml vendored Normal file
View file

@ -0,0 +1,70 @@
on: [push, pull_request]
name: CI
jobs:
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: apcu
- name: PHP-CS-Fixer
uses: OskarStark/php-cs-fixer-ga@2.16.7
with:
args: --diff --dry-run --allow-risky yes --stop-on-violation --using-cache=no --path-mode=intersection
phpstan:
name: PHPStan Static Analysis
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: apcu, smbclient
- name: Composer
run: composer install
- env:
BACKEND: smbclient
run: php ./vendor/bin/phpstan analyse --level 1 src
phpunit:
runs-on: ubuntu-20.04
name: Unit tests
services:
samba:
image: dperson/samba
env:
USER: "test;test"
SHARE: "test;/tmp;yes;no;yes;all;none"
ports:
- 139:139
- 445:445
steps:
- name: Install packages
run: |
sudo apt-get install smbclient
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.0'
extensions: apcu, smbclient
- name: Composer
run: composer install
- name: Config
run: |
echo '{"host": "localhost","user": "test","password": "test","share": "test","root": ""}' > tests/config.json
- name: PHPUnit Tests
env:
BACKEND: smbclient
run: php ./vendor/bin/phpunit tests