-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rewrite for more customizable library (#355)
BREAKING CHANGE: This new version is a rewrite with a lot of breaking changes, see details in https://github.com/asbiin/laravel-webauthn/blob/main/docs/migration-v1-to-v2.md
- Loading branch information
Showing
80 changed files
with
3,119 additions
and
1,635 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,25 +16,31 @@ on: | |
workflow_dispatch: | ||
|
||
env: | ||
php-version: '8.1' | ||
laravel-version: '8.*' | ||
node-version: 14 | ||
default-php-version: '8.1' | ||
default-laravel-version: '8.*' | ||
semantic-node-version: 16 | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
name: PHP ${{ matrix.php-version }} | Laravel ${{ matrix.laravel_version }} | ||
name: PHP ${{ matrix.php-version }} | Laravel ${{ matrix.laravel-version }} (${{ matrix.psr7 }}) | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php-version: ['7.4', '8.0', '8.1'] | ||
laravel_version: [6.*, 7.*, 8.*] | ||
laravel-version: [7.*, 8.*] | ||
psr7: ['guzzle'] | ||
exclude: | ||
- php-version: '8.1' | ||
laravel_version: '6.*' | ||
laravel-version: '7.*' | ||
include: | ||
- php-version: '8.1' | ||
laravel_version: '7.*' | ||
laravel-version: '8.*' | ||
psr7: 'nyholm' | ||
- php-version: '8.1' | ||
laravel-version: '8.*' | ||
psr7: 'discovery' | ||
|
||
steps: | ||
- name: Checkout sources | ||
|
@@ -63,27 +69,45 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }}-${{ matrix.laravel_version }} | ||
key: ${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }}-${{ matrix.laravel-version }} | ||
restore-keys: | | ||
${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }}-${{ matrix.laravel_version }} | ||
${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }}-${{ matrix.laravel-version }} | ||
${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }} | ||
${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }} | ||
${{ runner.os }}-composer-v4- | ||
- name: Install dependencies with Laravel ${{ matrix.laravel_version }} | ||
- name: Update dependencies with Laravel ${{ matrix.laravel-version }} | ||
run: | | ||
export COMPOSER_ROOT_VERSION=dev-main | ||
composer require "illuminate/support:${{ matrix.laravel-version }}" --no-update | ||
- name: Use psr7 variant (nyholm) | ||
if: matrix.psr7 == 'nyholm' | ||
run: | | ||
composer remove psr/http-factory-implementation --no-update | ||
composer remove --dev guzzlehttp/psr7 --no-update | ||
composer require --dev symfony/psr-http-message-bridge nyholm/psr7 --no-update | ||
- name: Use psr7 variant (with php-http/discovery) | ||
if: matrix.psr7 == 'discovery' | ||
run: | | ||
export COMPOSER_ROOT_VERSION=dev-master | ||
composer require "laravel/framework:${{ matrix.laravel_version }}" --no-interaction --no-progress --prefer-stable --prefer-dist | ||
composer remove psr/http-factory-implementation --no-update | ||
composer remove --dev guzzlehttp/psr7 --no-update | ||
composer require --dev symfony/psr-http-message-bridge php-http/discovery laminas/laminas-diactoros php-http/curl-client --no-update | ||
- name: Install dependencies | ||
run: | | ||
composer update --no-interaction --no-progress --prefer-dist | ||
- name: Run test suite | ||
run: phpdbg -dmemory_limit=4G -qrr vendor/bin/phpunit -c phpunit.xml --log-junit ./results/results.xml --coverage-clover ./results/coverage.xml | ||
run: phpdbg -dmemory_limit=4G -qrr vendor/bin/phpunit -c phpunit.xml --log-junit ./results/results_${{ matrix.psr7 }}.xml --coverage-clover ./results/coverage_${{ matrix.psr7 }}.xml | ||
|
||
- name: Fix results files | ||
run: sed -i -e "s%$GITHUB_WORKSPACE/%%g" *.xml | ||
working-directory: results | ||
|
||
- name: Store results | ||
if: matrix.php-version == '${{ env.php-version }}' && matrix.laravel_version == '${{ env.laravel-version }}' | ||
if: matrix.php-version == env.default-php-version && matrix.laravel-version == env.default-laravel-version | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: results | ||
|
@@ -112,12 +136,22 @@ jobs: | |
name: results | ||
path: results | ||
|
||
- name: Set coverage list | ||
id: coverage | ||
run: | | ||
SONAR_COVERAGE=$(ls -m --format=comma results/coverage*.xml | sed -e ':a;N;$!ba;s/\n//g; s/ //g;') | ||
echo "::set-output name=list::$SONAR_COVERAGE" | ||
- name: SonarCloud Scan | ||
if: env.SONAR_TOKEN != '' | ||
uses: SonarSource/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
with: | ||
args: | | ||
-Dsonar.php.tests.reportPath=./results/results_guzzle.xml | ||
-Dsonar.php.coverage.reportPaths=${{ steps.coverage.outputs.list }} | ||
#################### | ||
|
@@ -135,10 +169,10 @@ jobs: | |
with: | ||
fetch-depth: 0 # Get all tags | ||
|
||
- name: Use Node.js ${{ env.node-version }} | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ env.node-version }} | ||
node-version: ${{ env.semantic-node-version }} | ||
|
||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v2 | ||
|
@@ -149,7 +183,7 @@ jobs: | |
with: | ||
semantic_version: 18 | ||
extra_plugins: | | ||
@semantic-release/changelog | ||
@semantic-release/changelog@6 | ||
semantic-release-github-pullrequest | ||
- name: New release published | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.