diff --git a/.github/workflows/samples-php7.yaml b/.github/workflows/samples-php7.yaml new file mode 100644 index 00000000000..f675345bff5 --- /dev/null +++ b/.github/workflows/samples-php7.yaml @@ -0,0 +1,32 @@ +name: Samples PHP 7.x + +on: + push: + paths: + - samples/server/petstore/php-laravel/lib/ + pull_request: + paths: + - samples/server/petstore/php-laravel/lib/ +jobs: + build: + name: Build PHP projects + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # servers + - samples/server/petstore/php-laravel/lib/ + steps: + - uses: actions/checkout@v3 + - name: Setup PHP with tools + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + tools: php-cs-fixer, phpunit + - name: composer install + working-directory: ${{ matrix.sample }} + run: composer install + - name: phpunit + working-directory: ${{ matrix.sample }} + run: vendor/bin/phpunit diff --git a/.github/workflows/samples-php8.yaml b/.github/workflows/samples-php8.yaml new file mode 100644 index 00000000000..18c279bc3c6 --- /dev/null +++ b/.github/workflows/samples-php8.yaml @@ -0,0 +1,32 @@ +name: Samples PHP 8.x + +on: + push: + paths: + - samples/server/petstore/php-symfony/SymfonyBundle-php/ + pull_request: + paths: + - samples/server/petstore/php-symfony/SymfonyBundle-php/ +jobs: + build: + name: Build PHP projects + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sample: + # servers + - samples/server/petstore/php-symfony/SymfonyBundle-php/ + steps: + - uses: actions/checkout@v3 + - name: Setup PHP with tools + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + tools: php-cs-fixer, phpunit + - name: composer install + working-directory: ${{ matrix.sample }} + run: composer install + - name: phpunit + working-directory: ${{ matrix.sample }} + run: vendor/bin/phpunit diff --git a/bin/configs/php-laravel.yaml b/bin/configs/php-laravel.yaml index 2d29f5000a0..88d17374326 100644 --- a/bin/configs/php-laravel.yaml +++ b/bin/configs/php-laravel.yaml @@ -2,3 +2,5 @@ generatorName: php-laravel outputDir: samples/server/petstore/php-laravel inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/php-laravel +gitUserId: openapitools +gitRepoId: petstore diff --git a/bin/configs/php-symfony-SymfonyBundle-php.yaml b/bin/configs/php-symfony-SymfonyBundle-php.yaml index f7c6218a50f..45871b6da22 100644 --- a/bin/configs/php-symfony-SymfonyBundle-php.yaml +++ b/bin/configs/php-symfony-SymfonyBundle-php.yaml @@ -2,3 +2,5 @@ generatorName: php-symfony outputDir: samples/server/petstore/php-symfony/SymfonyBundle-php inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/php-symfony +gitUserId: openapitools +gitRepoId: petstore diff --git a/samples/server/petstore/php-laravel/lib/composer.json b/samples/server/petstore/php-laravel/lib/composer.json index ac7642b6f79..a794a18191d 100644 --- a/samples/server/petstore/php-laravel/lib/composer.json +++ b/samples/server/petstore/php-laravel/lib/composer.json @@ -1,5 +1,5 @@ { - "name": "GIT_USER_ID/GIT_REPO_ID", + "name": "openapitools/petstore", "description": ".", "keywords": ["framework", "laravel"], "license": "MIT", diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/README.md b/samples/server/petstore/php-symfony/SymfonyBundle-php/README.md index a4214748921..c39149e71d6 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/README.md +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/README.md @@ -26,7 +26,7 @@ To install the dependencies via [Composer](http://getcomposer.org/), add the fol Then run: ``` -composer require GIT_USER_ID/GIT_REPO_ID:dev-master +composer require openapitools/petstore:dev-master ``` to add the generated openapi bundle as a dependency. diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json b/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json index 7374fe0ceca..7683bf2cc88 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/composer.json @@ -1,5 +1,5 @@ { - "name": "GIT_USER_ID/GIT_REPO_ID", + "name": "openapitools/petstore", "description": "", "keywords": [ "openapi", diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh b/samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh index f53a75d4fab..1d215e4cb28 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/git_push.sh @@ -14,12 +14,12 @@ if [ "$git_host" = "" ]; then fi if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" + git_user_id="openapitools" echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" fi if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" + git_repo_id="petstore" echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" fi