Skip to content

Commit

Permalink
Merge pull request #52 from cybex-gmbh/master
Browse files Browse the repository at this point in the history
test coverage, bugfixes, quality of life improvements
  • Loading branch information
gael-connan-cybex authored Sep 6, 2022
2 parents 5d2736c + 145d201 commit ea414c6
Show file tree
Hide file tree
Showing 96 changed files with 5,706 additions and 613 deletions.
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
APP_SERVICE=app
DB_HOST=laravel-protector-mysql_testing-1
DB_DATABASE=protector_test
DB_USERNAME=forge
DB_PASSWORD=forge
102 changes: 56 additions & 46 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,61 @@
name: Tests

on:
push:
branches:
- master
- release/*
pull_request:
workflow_dispatch:
push:
branches:
- master
- release/*
pull_request:
workflow_dispatch:

jobs:
linux_tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [ 8.0, 8.1 ]
laravel: [ 8.*, 9.* ]
dependency-version: [ prefer-stable ]

name: PHP ${{ matrix.php }} with Laravel ${{ matrix.laravel }} (${{ matrix.dependency-version }})

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd
tools: composer:v2
coverage: none

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
restore-keys: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update --dev --no-progress
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest --no-progress
- name: Execute tests
run: vendor/bin/phpunit
linux_tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: true
matrix:
php: [ 8.0, 8.1 ]
laravel: [ 8.*, 9.* ]
dependency-version: [ prefer-stable ]

name: PHP ${{ matrix.php }} with Laravel ${{ matrix.laravel }} (${{ matrix.dependency-version }})

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd
tools: composer:v2
coverage: none

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
restore-keys: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update --dev --no-progress
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit
env:
DB_PORT: ${{ job.services.mysql.ports[3306] }}
19 changes: 0 additions & 19 deletions .scrutinizer.yml

This file was deleted.

4 changes: 0 additions & 4 deletions .styleci.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

24 changes: 16 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ Please be considerate towards maintainers when raising issues or presenting pull
world that developers are civilized and selfless people.

It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.
quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the
maintainer's decision, and do not be upset or abusive if your submission is not used.

## Viability

Expand All @@ -40,16 +41,23 @@ Before submitting a pull request:

If the project maintainer has any additional requirements, you will find them listed here.

- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer).
- **[PSR-12 Coding Standard.](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md)**
The easiest way to apply the conventions is to
install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer).

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
- **Add tests!** Your patch won't be accepted if it doesn't have tests.

- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
- **Document any change in behaviour.** Make sure the `README.md` and any other relevant documentation are kept
up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.
- **Consider our release cycle.** We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs
is not an option.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
- **One pull request per feature.** If you want to do more than one thing, send multiple pull requests.

- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
- **Send coherent history.** Make sure each individual commit in your pull request is meaningful. If you had to make
multiple intermediate commits while developing,
please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages)
before submitting.

**Happy coding**!
**Happy coding!**
5 changes: 3 additions & 2 deletions Migrations/add_public_key_to_users_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ class AddPublicKeyToUsersTable extends Migration
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('protector_public_key')->unique()->nullable()->comment('The sodium public key for the Protector package.');
$table->string('protector_public_key')->unique()->nullable()->comment(
'The sodium public key for the Protector package.'
);
});
}

Expand All @@ -25,6 +27,5 @@ public function up()
*/
public function down()
{

}
}
Loading

0 comments on commit ea414c6

Please sign in to comment.