forked from loafle/openapi-generator-original
Test PHP Symfony server sample in github action (#12533)
* test php symfony server sample in github action * update php laravel samples * add tests for php 7.x, 8.x
This commit is contained in:
parent
fe8187ba6d
commit
38018d8b94
32
.github/workflows/samples-php7.yaml
vendored
Normal file
32
.github/workflows/samples-php7.yaml
vendored
Normal file
@ -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
|
32
.github/workflows/samples-php8.yaml
vendored
Normal file
32
.github/workflows/samples-php8.yaml
vendored
Normal file
@ -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
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "GIT_USER_ID/GIT_REPO_ID",
|
||||
"name": "openapitools/petstore",
|
||||
"description": ".",
|
||||
"keywords": ["framework", "laravel"],
|
||||
"license": "MIT",
|
||||
|
@ -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.
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "GIT_USER_ID/GIT_REPO_ID",
|
||||
"name": "openapitools/petstore",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"openapi",
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user