NEXT-00000 - Add github actions #1
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
name: Integration | |
on: | |
pull_request: | |
jobs: | |
danger: | |
runs-on: ubuntu-latest | |
if: ${{ !github.event.act }} | |
steps: | |
- name: Clone | |
uses: actions/checkout@v1 | |
- name: Danger | |
uses: shyim/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_PULL_REQUEST_ID: ${{ github.event.pull_request.number }} | |
build_zip: | |
name: Build and validate zip | |
runs-on: ubuntu-latest | |
steps: | |
- name: Build | |
uses: shopware/github-actions/build-zip@main | |
with: | |
extensionName: ${{ github.event.repository.name }} | |
codestyle_php: | |
name: Codestyle PHP | |
runs-on: ubuntu-latest | |
steps: | |
- uses: shopware/github-actions/cs-fixer@main | |
with: | |
rules: "" | |
phpunit: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
PLATFORM_BRANCH: ["v6.6.1.0", "trunk"] | |
steps: | |
- uses: shopware/github-actions/setup-extension@main | |
with: | |
extensionName: ${{ github.event.repository.name }} | |
install: true | |
shopwareVersion: ${{ matrix.PLATFORM_BRANCH }} | |
extraRepositories: | | |
{ | |
"${{ github.event.repository.name }}": { | |
"type": "path", | |
"url": "custom/plugins/${{ github.event.repository.name }}", | |
"symlink": true | |
} | |
} | |
- name: Clone TestData | |
working-directory: custom/plugins/${{ github.event.repository.name }}/tests | |
run: | | |
git clone https://${{ secrets.TESTDATA_CLONE_TOKEN }}@gitlab.shopware.com/shopware/6/services/testdata.git testData | |
mysql < testData/Migration/sw55.sql | |
- name: Run PHPUnit | |
working-directory: custom/plugins/${{ github.event.repository.name }} | |
run: php -d pcov.enabled=1 -d pcov.directory=${PWD} -d pcov.exclude='~(vendor|tests|node_modules)~' ${GITHUB_WORKSPACE}/vendor/bin/phpunit --configuration phpunit.xml.dist | |
smoke_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: shopware/github-actions/setup-extension@main | |
with: | |
extensionName: ${{ github.event.repository.name }} | |
install: true | |
install-admin: true | |
install-storefront: true | |
extraRepositories: | | |
{ | |
"${{ github.event.repository.name }}": { | |
"type": "path", | |
"url": "custom/plugins/${{ github.event.repository.name }}", | |
"symlink": true | |
} | |
} | |
- name: Uninstall Plugin | |
run: php bin/console plugin:uninstall ${{ github.event.repository.name }} | |
acceptance: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
PLATFORM_BRANCH: ["v6.6.1.0", "trunk"] | |
steps: | |
- uses: shopware/github-actions/setup-extension@main | |
with: | |
extensionName: ${{ github.event.repository.name }} | |
install: true | |
install-admin: true | |
install-storefront: true | |
env: prod | |
extraRepositories: | | |
{ | |
"${{ github.event.repository.name }}": { | |
"type": "path", | |
"url": "custom/plugins/${{ github.event.repository.name }}", | |
"symlink": true | |
} | |
} | |
- name: Setup Migration Assistant | |
run: | | |
composer run build:js:admin | |
cd custom/plugins/${{ github.event.repository.name }}/tests | |
git clone https://${{ secrets.TESTDATA_CLONE_TOKEN }}@gitlab.shopware.com/shopware/6/services/testdata.git testData | |
mysql < testData/Migration/sw55.sql | |
- name: Change permissions | |
run: chown -R www-data:www-data . | |
- name: Install playwright | |
working-directory: custom/plugins/${{ github.event.repository.name }}/tests/acceptance | |
run: | | |
npm ci | |
npx playwright install --with-deps | |
- name: Run Playwright | |
working-directory: custom/plugins/${{ github.event.repository.name }}/tests/acceptance | |
run: | | |
npx playwright test --workers=1 |