From bea3729eb67b30ce863495018cf78a09bb3a619a Mon Sep 17 00:00:00 2001 From: Florian Keller Date: Fri, 19 Jul 2024 12:39:49 +0200 Subject: [PATCH] PPI-955 - Added Github actions --- .github/workflows/admin.yml | 17 ++++++++++++++++ .github/workflows/build.yml | 8 ++++++++ .github/workflows/php.yml | 12 +++++++++++ .github/workflows/storefront.yml | 35 ++++++++++++++++++++++++++++++++ .github/workflows/unit.yml | 19 +++++++++++++++++ 5 files changed, 91 insertions(+) create mode 100644 .github/workflows/admin.yml create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/php.yml create mode 100644 .github/workflows/storefront.yml create mode 100644 .github/workflows/unit.yml diff --git a/.github/workflows/admin.yml b/.github/workflows/admin.yml new file mode 100644 index 000000000..e6d4bd4ae --- /dev/null +++ b/.github/workflows/admin.yml @@ -0,0 +1,17 @@ +name: Administration +on: + push: +jobs: + unit: + name: Jest + uses: shopware/github-actions/.github/workflows/admin-jest.yml@main + with: + extensionName: ${{ github.event.repository.name }} + uploadCoverage: true + secrets: + codecovToken: ${{ secrets.CODECOV_TOKEN }} + lint: + name: ESLint + uses: shopware/github-actions/.github/workflows/admin-eslint.yml@main + with: + extensionName: ${{ github.event.repository.name }} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..f3ac165a5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,8 @@ +name: Build +on: + push: +jobs: + build: + uses: shopware/github-actions/.github/workflows/build-zip.yml@main + with: + extensionName: ${{ github.event.repository.name }} \ No newline at end of file diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 000000000..b340e1b52 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,12 @@ +name: PHP +on: + push: + paths: + - '**/*.php' +jobs: + cs: + uses: shopware/github-actions/.github/workflows/cs-fixer.yml@main + phpstan: + uses: shopware/github-actions/.github/workflows/phpstan.yml@main + with: + extensionName: ${{ github.event.repository.name }} \ No newline at end of file diff --git a/.github/workflows/storefront.yml b/.github/workflows/storefront.yml new file mode 100644 index 000000000..47629e08b --- /dev/null +++ b/.github/workflows/storefront.yml @@ -0,0 +1,35 @@ +name: ESLint Storefront +on: + push: +jobs: + run: + name: ESLint Storefront + runs-on: ubuntu-latest + steps: + - name: Clone Shopware + uses: actions/checkout@v4 + with: + repository: shopware/shopware + ref: trunk + + - name: Clone Extension + uses: actions/checkout@v4 + with: + path: custom/plugins/${{ inputs.extensionName }} + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Install Plugin Dependencies + working-directory: custom/plugins/${{ inputs.extensionName }}/src/Resources/app/storefront + run: npm install --no-audit --no-fund --prefer-offline + + - name: Install platform Dependencies + working-directory: src/Storefront/Resources/app/storefront + run: npm install --no-audit --no-fund --prefer-offline + + - name: Run ESLint + working-directory: custom/plugins/${{ inputs.extensionName }} + run: ../../src/Storefront/Resources/app/storefront/node_modules/.bin/eslint --config ../../src/Storefront/Resources/app/storefront/.eslintrc.js src/Resources/app/storefront \ No newline at end of file diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml new file mode 100644 index 000000000..7c5cb00d6 --- /dev/null +++ b/.github/workflows/unit.yml @@ -0,0 +1,19 @@ +name: Unit +on: + push: + workflow_dispatch: +jobs: + phpunit: + uses: FlorianKe/github-actions/.github/workflows/phpunit.yml@added-lint-and-plugin-composer-install + with: + extensionName: ${{ github.event.repository.name }} + composerInstall: true + shopwareVersion: trunk + uploadCoverage: true + dependencies: | + [ + { "name": "SwagCmsExtensions", "repo": "git@github.com:shopware/SwagCmsExtensions.git" }, + { "name": "SwagCommercial", "repo": "git@gitlab.shopware.com:shopware/6/product/commercial.git" } + ] + secrets: + codecovToken: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file