Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Add php release support #1199 #1201

Merged
merged 4 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions .github/workflows/agdb_api_php.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,28 @@ jobs:
- id: diff
shell: bash
run: |
if [[ "$(git diff origin/main --name-only -- agdb_api/php/ agdb_server/openapi/schema.json .github/workflows/agdb_api_php.yaml)" != "" ]]; then (echo "diff=true" >> $GITHUB_OUTPUT); fi
if [[ "$(git diff origin/main --name-only -- composer.json agdb_api/php/ .github/workflows/agdb_api_php.yaml)" != "" ]]; then (echo "diff=true" >> $GITHUB_OUTPUT); fi

agdb_api_php_analyse:
runs-on: ubuntu-24.04
needs: diff
if: needs.diff.outputs.diff == 'true'
defaults:
run:
working-directory: agdb_api/php
steps:
- uses: actions/checkout@v4
- run: composer install
- run: ./ci.sh analyse
working-directory: agdb_api/php

agdb_api_php_coverage:
runs-on: ubuntu-24.04
needs: diff
if: needs.diff.outputs.diff == 'true'
defaults:
run:
working-directory: agdb_api/php
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: composer install
- run: ./ci.sh coverage
working-directory: agdb_api/php
- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/agdb_api_typescript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- id: diff
shell: bash
run: |
if [[ "$(git diff origin/main --name-only -- agdb_api/typescript/ agdb_server/openapi/schema.json .github/workflows/agdb_api_typescript.yaml)" != "" ]]; then (echo "diff=true" >> $GITHUB_OUTPUT); fi
if [[ "$(git diff origin/main --name-only -- agdb_api/typescript/ .github/workflows/agdb_api_typescript.yaml)" != "" ]]; then (echo "diff=true" >> $GITHUB_OUTPUT); fi

agdb_api_typescript_analyse:
runs-on: ubuntu-latest
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ agdb_server_data/
!.github/workflows/agdb_benchmarks.yaml
!.github/workflows/agdb_server.yaml
test.log
vendor/
coverage/
node_modules/
openapitools.json
.openapi-generator/
5 changes: 0 additions & 5 deletions agdb_api/php/.gitignore

This file was deleted.

6 changes: 3 additions & 3 deletions agdb_api/php/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cluster: []" > agdb_server.yaml
sleep 3

local output
output=$(XDEBUG_MODE=coverage ./vendor/bin/phpunit tests --coverage-filter src/ --coverage-text --coverage-html coverage/)
output=$(XDEBUG_MODE=coverage ../../vendor/bin/phpunit tests --coverage-filter src/ --coverage-text --coverage-html coverage/)
local error_code=$?
echo "ERROR CODE: $error_code"
echo "$output"
Expand Down Expand Up @@ -65,7 +65,7 @@ cluster: []" > agdb_server.yaml
}

function analyse() {
./vendor/bin/phpstan analyse --level=9 -v src tests
../../vendor/bin/phpstan analyse --level=9 -v src tests
}

function format() {
Expand All @@ -78,7 +78,7 @@ function generate_api() {
-g php \
-o ./ \
--additional-properties=invokerPackage=Agdb,artifactVersion=0.7.2
composer dump-autoload -o
echo "Y" | composer dump-autoload -o
}

function generate_tests() {
Expand Down
19 changes: 10 additions & 9 deletions agdb_api/php/composer.json → composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"version": "0.7.2",
"name": "agnesoft/agdb_api",
"type": "library",
"description": "Agnesoft Graph Database API client for PHP",
"keywords": [
"openapitools",
Expand All @@ -12,23 +13,23 @@
],
"homepage": "https://github.com/agnesoft/agdb",
"license": "Apache-2.0",
"authors": [
{
"name": "Agnesoft",
"homepage": "https://github.com/agnesoft/agdb"
}
],
"autoload": {
"classmap": [
"src",
"lib"
"agdb_api/php/src",
"agdb_api/php/lib"
]
},
"config": {
"allow-plugins": {
"php-http/discovery": true
}
},
"authors": [
{
"name": "Agnesoft",
"homepage": "https://github.com/agnesoft/agdb"
}
],
"require": {
"php": "^7.4 || ^8.0",
"ext-curl": "*",
Expand Down
Loading