Skip to content

PO-489 - Add Github actions #96

PO-489 - Add Github actions

PO-489 - Add Github actions #96

Workflow file for this run

name: PHP checks
on:
push:
branches:
- trunk
pull_request:
workflow_dispatch:
workflow_call:
permissions:
contents: read
id-token: write
jobs:
phpstan:
runs-on: ubuntu-latest
steps:
- uses: octo-sts/action@main
id: octo-sts
with:
scope: shopware
identity: ${{ github.event.repository.name }}
- uses: shopware/github-actions/setup-extension@feat/add-token-to-dependencies
with:
extensionName: ${{ github.event.repository.name }}
install: true
installAdmin: true
installStorefront: true
dependencies: |
[
{
"name":"SwagCommercial",
"repo": "https://github.com/shopware/SwagCommercial.git",
"token": "${{ steps.octo-sts.outputs.token }}"
},
{
"name":"SwagCmsExtensions",
"repo": "https://github.com/shopware/SwagCmsExtensions.git",
"token": "${{ steps.octo-sts.outputs.token }}"
}
]
extraRepositories: |
{
"${{ github.event.repository.name }}": {
"type": "path",
"url": "custom/plugins/${{ github.event.repository.name }}",
"symlink": true
},
"SwagCommercial": {
"type": "path",
"url": "custom/plugins/SwagCommercial",
"symlink": true
},
"SwagCmsExtensions": {
"type": "path",
"url": "custom/plugins/SwagCmsExtensions",
"symlink": true
}
}
- run: |
symfony composer -d custom/plugins/${{ github.event.repository.name }} run phpstan
validate-openapi-typescript:
runs-on: ubuntu-latest
steps:
- name: Setup Extension
uses: shopware/github-actions/setup-extension@main
env:
runner: ${{ runner.environment }}
with:
extensionName: ${{ github.event.repository.name }}
install: true
installAdmin: true
installStorefront: true
- working-directory: custom/plugins/${{ github.event.repository.name }}
run: |
${GITHUB_WORKSPACE}/bin/console bundle:dump
composer init:admin
composer openapi:generate
git update-index --refresh || printf ''
git diff-index "${{ github.sha }}" --quiet -- src/Resources/app/administration/src/types/openapi.d.ts || (echo "Please run 'composer openapi:generate' to update openapi.d.ts" && exit 1)