From 738db138d371f14191d9b32797213c1dc07552fe Mon Sep 17 00:00:00 2001 From: Jonathan VUILLEMIN Date: Wed, 14 Apr 2021 14:28:36 +0200 Subject: [PATCH 1/3] feat: core 6.x --- CHANGELOG.md | 8 ++++++++ README.md | 2 +- composer.json | 2 +- tests/Integration/DeepLinkingFlowTest.php | 4 ++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f9d2af0..d9e2d7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ CHANGELOG ========= +4.0.0 +----- + +* Added github actions CI +* Removed jenkins and travis CI +* Updated oat-sa/lib-lti1p3-core dependency to version 6.0 +* Updated documentation + 3.0.0 ----- diff --git a/README.md b/README.md index 3880a67..0e97a6b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Latest Version](https://img.shields.io/github/tag/oat-sa/lib-lti1p3-deep-linking.svg?style=flat&label=release)](https://github.com/oat-sa/lib-lti1p3-deep-linking/tags) [![License GPL2](http://img.shields.io/badge/licence-GPL%202.0-blue.svg)](http://www.gnu.org/licenses/gpl-2.0.html) -[![Build Status](https://travis-ci.org/oat-sa/lib-lti1p3-deep-linking.svg?branch=master)](https://travis-ci.org/oat-sa/lib-lti1p3-deep-linking) +[![Build Status](https://github.com/oat-sa/lib-lti1p3-deep-linking/actions/workflows/build.yaml/badge.svg?branch=master)](https://github.com/oat-sa/lib-lti1p3-deep-linking/actions) [![Test Coverage Status](https://coveralls.io/repos/github/oat-sa/lib-lti1p3-deep-linking/badge.svg?branch=master)](https://coveralls.io/github/oat-sa/lib-lti1p3-deep-linking?branch=master) [![Psalm Level Status](https://shepherd.dev/github/oat-sa/lib-lti1p3-deep-linking/level.svg)](https://shepherd.dev/github/oat-sa/lib-lti1p3-deep-linking) [![Packagist Downloads](http://img.shields.io/packagist/dt/oat-sa/lib-lti1p3-deep-linking.svg)](https://packagist.org/packages/oat-sa/lib-lti1p3-deep-linking) diff --git a/composer.json b/composer.json index cc05d82..9ee4f7b 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "require": { "ext-json": "*", "php": ">=7.2.0", - "oat-sa/lib-lti1p3-core": "^5.0" + "oat-sa/lib-lti1p3-core": "^6.0" }, "require-dev": { "phpunit/phpunit": "8.5.14", diff --git a/tests/Integration/DeepLinkingFlowTest.php b/tests/Integration/DeepLinkingFlowTest.php index d74bcd0..08b5fee 100644 --- a/tests/Integration/DeepLinkingFlowTest.php +++ b/tests/Integration/DeepLinkingFlowTest.php @@ -22,8 +22,8 @@ namespace OAT\Library\Lti1p3DeepLinking\Tests\Integration; -use OAT\Library\Lti1p3Core\Message\Launch\Validator\PlatformLaunchValidator; -use OAT\Library\Lti1p3Core\Message\Launch\Validator\ToolLaunchValidator; +use OAT\Library\Lti1p3Core\Message\Launch\Validator\Platform\PlatformLaunchValidator; +use OAT\Library\Lti1p3Core\Message\Launch\Validator\Tool\ToolLaunchValidator; use OAT\Library\Lti1p3Core\Message\LtiMessageInterface; use OAT\Library\Lti1p3Core\Resource\LtiResourceLink\LtiResourceLink; use OAT\Library\Lti1p3Core\Resource\LtiResourceLink\LtiResourceLinkInterface; From 4f98873f2194619159c95010da3d6735dd79b44e Mon Sep 17 00:00:00 2001 From: gitromba Date: Wed, 14 Apr 2021 14:30:08 +0200 Subject: [PATCH 2/3] ci: replace Jenkins and Travis CI in favor of GH Action CI --- .Jenkinsfile | 33 ------------------------- .github/workflows/build.yaml | 48 ++++++++++++++++++++++++++++++++++++ .travis.yml | 20 --------------- 3 files changed, 48 insertions(+), 53 deletions(-) delete mode 100644 .Jenkinsfile create mode 100644 .github/workflows/build.yaml delete mode 100644 .travis.yml diff --git a/.Jenkinsfile b/.Jenkinsfile deleted file mode 100644 index ef792c6..0000000 --- a/.Jenkinsfile +++ /dev/null @@ -1,33 +0,0 @@ -pipeline { - agent { - label 'master' - } - stages { - stage('Tests') { - agent { - docker { - image 'alexwijn/docker-git-php-composer' - reuseNode true - } - } - environment { - HOME = '.' - } - options { - skipDefaultCheckout() - } - steps { - withCredentials([string(credentialsId: 'jenkins_github_token', variable: 'GIT_TOKEN')]) { - sh( - label: 'Install/Update sources from Composer', - script: "COMPOSER_AUTH='{\"github-oauth\": {\"github.com\": \"$GIT_TOKEN\"}}\' composer update --no-interaction --no-ansi --no-progress" - ) - } - sh( - label: 'Run backend tests', - script: './vendor/bin/phpunit' - ) - } - } - } -} diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..28c7876 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,48 @@ +name: Build + +on: push + +jobs: + build: + runs-on: ubuntu-20.04 + + strategy: + fail-fast: false + matrix: + php: [7.2, 7.3, 7.4] + coverage: ["true"] + include: + - php: 8.0 + coverage: "false" # PHPUnit 8.5.14 doesn't support code coverage under PHP 8 + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP & Composer + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: composer:v2 + + - name: Install dependencies + run: composer install --no-interaction --no-suggest + + - name: PHPUnit + env: + COVERAGE: ${{ matrix.coverage }} + run: | + [ $COVERAGE = "true" ] \ + && mkdir -p build/logs && ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml \ + || ./vendor/bin/phpunit + + - name: Psalm + run: | + ./vendor/bin/psalm --shepherd + + - name: Coveralls + if: ${{ matrix.coverage == 'true' }} + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + ./vendor/bin/php-coveralls -v diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a85b772..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -os: linux -dist: xenial -language: php - -php: - - 7.2 - - 7.3 - - 7.4 - - 8.0 - -before_script: - - composer self-update && composer install --no-interaction - -script: - - mkdir -p build/logs - - ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml - - ./vendor/bin/psalm --shepherd - -after_script: - - ./vendor/bin/php-coveralls -v From 12c32e591636c17c4f0bb2c42209b4656a5dc60c Mon Sep 17 00:00:00 2001 From: Jonathan VUILLEMIN Date: Wed, 14 Apr 2021 14:32:49 +0200 Subject: [PATCH 3/3] fix: doc --- doc/deep-linking-workflow.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/deep-linking-workflow.md b/doc/deep-linking-workflow.md index 539f010..e027764 100644 --- a/doc/deep-linking-workflow.md +++ b/doc/deep-linking-workflow.md @@ -121,7 +121,7 @@ You can use the [ToolLaunchValidator](https://github.com/oat-sa/lib-lti1p3-core/ ```php hasError()) { When a deep linking request is received by a tool, the tool may offer the user [content items](https://www.imsglobal.org/spec/lti-dl/v2p0/#content-item-types) selection according to the platform deep linking settings. For example: + ```php validatePlatformOriginatingLaunch($request); if (!$result->hasError()) { @@ -211,11 +212,11 @@ Once the resource collection ready, you can return it to the platform in a [deep ```php validatePlatformOriginatingLaunch(...); // Create a builder instance @@ -269,7 +270,7 @@ The [PlatformLaunchValidator](https://github.com/oat-sa/lib-lti1p3-core/blob/mas ```php validateToolOriginatingLaunch($request); if (!$result->hasError()) {