chore: test #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: Storefront checks and tests | |
on: | |
pull_request: | |
workflow_dispatch: | |
workflow_call: | |
jobs: | |
lint: | |
runs-on: ubuntu-24.04 | |
env: | |
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true" | |
COMPOSER_ROOT_VERSION: 6.6.9999999-dev | |
steps: | |
- name: Setup Shopware | |
uses: shopware/setup-shopware@main | |
with: | |
mysql-version: skip | |
shopware-version: ${{ github.ref }} | |
shopware-repository: ${{ github.repository }} | |
- name: Cache ESLint and Stylelint | |
uses: actions/cache@v4 | |
with: | |
path: | | |
src/Storefront/Resources/app/storefront/node_modules/.eslintcache | |
src/Storefront/Resources/app/storefront/node_modules/.stylelintcache | |
key: storefront-lint-${{ runner.os }}-6.6 | |
- name: Build Storefront | |
env: | |
PROJECT_ROOT: ${{ github.workspace }} | |
run: | | |
symfony console bundle:dump | |
symfony console feature:dump | |
npm --prefix src/Storefront/Resources/app/storefront ci | |
npm --prefix src/Storefront/Resources/app/storefront run production | |
- name: Check Code | |
working-directory: src/Storefront/Resources/app/storefront | |
run: | | |
npm run lint:js | |
npm run lint:scss | |
jest: | |
name: "Jest Storefront" | |
runs-on: ubuntu-24.04 | |
env: | |
APP_ENV: prod | |
APP_URL: http://localhost:8000 | |
APP_SECRET: def00000bb5acb32b54ff8ee130270586eec0e878f7337dc7a837acc31d3ff00f93a56b595448b4b29664847dd51991b3314ff65aeeeb761a133b0ec0e070433bff08e48 | |
OPENSEARCH_URL: elasticsearch:9200 | |
BLUE_GREEN_DEPLOYMENT: 1 | |
COMPOSER_ROOT_VERSION: 6.6.9999999-dev | |
steps: | |
- name: Setup Shopware | |
uses: shopware/setup-shopware@main | |
with: | |
mysql-version: skip | |
shopware-version: ${{ github.ref }} | |
shopware-repository: ${{ github.repository }} | |
- name: Run Jest Storefront | |
working-directory: src/Storefront/Resources/app/storefront | |
run: | | |
npm ci | |
npm run unit -- --silent | |
- name: Upload coverage | |
uses: codecov/codecov-action@v5 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
with: | |
files: build/artifacts/jest/cobertura-coverage.xml | |
flags: jest-storefront | |
license-check: | |
runs-on: ubuntu-24.04 | |
name: "License check" | |
env: | |
WHITELISTED_JS_PACKAGES: "[email protected];administration;[email protected]" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: package*.json changed | |
id: changed-package-json | |
uses: tj-actions/changed-files@v45 | |
with: | |
files: src/Storefront/Resources/app/storefront/package*.json | |
- uses: actions/setup-node@v4 | |
if: steps.changed-package-json.outputs.any_changed == 'true' | |
with: | |
node-version: 20 | |
- name: install packages | |
if: steps.changed-package-json.outputs.any_changed == 'true' | |
working-directory: src/Storefront/Resources/app/storefront | |
run: | | |
npm ci | |
- name: Check license | |
if: steps.changed-package-json.outputs.any_changed == 'true' | |
working-directory: src/Storefront/Resources/app/storefront | |
run: | | |
npx license-checker-rseidelsohn \ | |
--onlyAllow "$(tr \\n \; < ${{ github.workspace }}/.allowed-licenses)" \ | |
--excludePackages "${WHITELISTED_JS_PACKAGES}" \ | |
--excludePrivatePackages | |
storefront-check: | |
if: always() | |
needs: | |
- lint | |
- jest | |
- license-check | |
runs-on: Ubuntu-latest | |
steps: | |
- name: Decide whether the needed jobs succeeded or failed | |
uses: re-actors/alls-green@release/v1 | |
with: | |
# allowed-failures: docs, linters | |
# allowed-skips: non-voting-flaky-job | |
jobs: ${{ toJSON(needs) }} |