-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OXDEV-7758: Set explicit version constraints and documentation versio…
…n as env
- Loading branch information
1 parent
ba71ec0
commit c386bb7
Showing
1 changed file
with
10 additions
and
45 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 |
---|---|---|
|
@@ -3,39 +3,13 @@ name: Schema | |
env: | ||
PHP_VERSION: '8.1' | ||
MYSQL_VERSION: '8.0' | ||
DOCUMENTATION_VERSION: '8.0' | ||
BASE_MODULE_VERSION: '~8.0' | ||
STOREFRONT_MODULE_VERSION: '^3.0' | ||
CONFIGURATION_MODULE_VERSION: '~1.0' | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
updated_module: | ||
description: the module that triggered the schema workflow | ||
require: true | ||
type: string | ||
updated_module_version: | ||
description: the version of the triggering module | ||
require: true | ||
type: string | ||
# doc_version: | ||
# description: version where the schema should be generated for | ||
# required: true | ||
# default: '8.0' | ||
# type: choice | ||
# options: | ||
# base_version: | ||
# description: graphql-base version for schema generation | ||
# required: true | ||
# default: latest | ||
# type: string | ||
# storefront_version: | ||
# description: graphql-storefront version for schema generation | ||
# required: true | ||
# default: latest | ||
# type: string | ||
# configuration_access_version: | ||
# description: graphql-configuration access version for schema generation | ||
# required: true | ||
# default: latest | ||
# type: string | ||
|
||
|
||
jobs: | ||
|
@@ -95,21 +69,12 @@ jobs: | |
sleep 2 | ||
- name: Install module and dependencies if base | ||
if: ${{ inputs.updated_module != 'graphql_storefront' }} | ||
run: | | ||
docker-compose exec -T php composer require oxid-esales/graphql-base:${{inputs.updated_module_version}} --no-update | ||
docker-compose exec -T php composer require oxid-esales/graphql-storefront --no-update | ||
docker-compose exec -T php composer require oxid-esales/graphql-base:${{env.BASE_MODULE_VERSION}} --no-update | ||
docker-compose exec -T php composer require oxid-esales/graphql-storefront:${{env.STOREFRONT_MODULE_VERSION}} --no-update | ||
# docker-compose exec -T php composer require oxid-esales/graphql-configuration-access:${{env.CONFIGURATION_MODULE_VERSION}} --no-update | ||
docker-compose exec -T php composer update --no-interaction | ||
|
||
- name: Install module and dependencies if storefront | ||
if: ${{ inputs.updated_module == 'graphql_storefront' }} | ||
run: | | ||
docker-compose exec -T php composer require oxid-esales/graphql-storefront:${{inputs.updated_module_version}} --no-update | ||
docker-compose exec -T php composer update --no-interaction | ||
- name: Get documentation version for schema | ||
run: DOCUMENTATION_VERSION = ${docker-compose exec -T php composer show 'oxid-esales/graphql-base' | sed -n '/versions/s/^[^0-9]\+\([^,]\+\).[^0-9]$/\1/p'} | ||
|
||
- name: Install module and dependencies | ||
run: | | ||
docker-compose exec -T php composer require oxid-esales/graphql-storefront --no-update | ||
|
@@ -134,8 +99,8 @@ jobs: | |
|
||
- name: Remove old schema for version | ||
run: | | ||
if [ -d "$GITHUB_WORKSPACE/docs/_static/schema/$DOCUMENTATION_VERSION" ]; then | ||
rm -Rf $GITHUB_WORKSPACE/docs/_static/schema/$DOCUMENTATION_VERSION; | ||
if [ -d "$GITHUB_WORKSPACE/docs/_static/schema/${{env.DOCUMENTATION_VERSION}}" ]; then | ||
rm -Rf $GITHUB_WORKSPACE/docs/_static/schema/${{env.DOCUMENTATION_VERSION}}; | ||
fi | ||
- name: Generate documentation | ||
|
@@ -144,7 +109,7 @@ jobs: | |
sudo npm install -g @2fd/graphdoc | ||
sleep 2; | ||
TOKEN=$(curl --silent http://localhost/graphql?skipSession=1 -H 'Content-Type: application/json' --data-binary '{"query":"query {token(username: \"[email protected]\", password:\"admin\")}"}' | sed -n 's|.*"token":"\(.*\)\"}}|\1|p') | ||
graphdoc -e http://localhost/graphql?skipSession=1 -o $GITHUB_WORKSPACE/docs/_static/schema/$DOCUMENTATION_VERSION -f -x "Authorization: Bearer $TOKEN" | ||
graphdoc -e http://localhost/graphql?skipSession=1 -o $GITHUB_WORKSPACE/docs/_static/schema/${{env.DOCUMENTATION_VERSION}} -f -x "Authorization: Bearer $TOKEN" | ||
# - name: Deploy | ||
# uses: JamesIves/github-pages-deploy-action@releases/v3 | ||
|