Cron Update JS Routing #1325
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: Cron Update JS Routing | |
on: | |
schedule: | |
- cron: '0 23 * * *' | |
workflow_dispatch: | |
permissions: { } | |
jobs: | |
js-routing-dump: | |
permissions: | |
contents: write # to create branch (peter-evans/create-pull-request) | |
pull-requests: write # to create a PR (peter-evans/create-pull-request) | |
runs-on: ubuntu-latest | |
name: Update JS Routing | |
strategy: | |
fail-fast: false | |
matrix: | |
BRANCH: | |
- develop | |
- 9.0.x | |
- 8.2.x | |
- 8.1.x | |
- 8.0.x | |
include: | |
- BRANCH: develop | |
node: 20 | |
- BRANCH: 9.0.x | |
node: 20 | |
- BRANCH: 8.2.x | |
node: 16 | |
env: | |
PHP_VERSION: '7.4' | |
NODE_VERSION: ${{ matrix.node }} | |
GH_BRANCH: ${{ matrix.BRANCH }} | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ env.PHP_VERSION }} | |
extensions: mbstring, intl, gd, xml, dom, json, fileinfo, curl, zip, iconv, simplexml | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup MySQL | |
uses: mirromutth/[email protected] | |
with: | |
mysql version: '5.7' | |
mysql database: 'prestashop' | |
mysql root password: 'password' | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ env.GH_BRANCH }} | |
- name: PrestaShop Configuration | |
run: cp .github/workflows/phpunit/parameters.yml app/config/parameters.yml | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache Node Directory | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Cache Composer Directory | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
- name: Install Composer dependencies | |
run: COMPOSER_PROCESS_TIMEOUT=600 composer install --ansi --prefer-dist --no-interaction --no-progress | |
- name: Build assets | |
run: make assets | |
- name: Install PrestaShop | |
# yamllint disable-line rule:line-length | |
run: php install-dev/index_cli.php --language=en --country=fr --domain=localhost --db_server=127.0.0.1 --db_password=password --db_name=prestashop --db_create=1 --name=prestashop.unit.test [email protected] --password=prestashop_demo | |
- name: Dump JS Routing file | |
# yamllint disable-line rule:line-length | |
run: php bin/console fos:js-routing:dump --format=json --target=admin-dev/themes/new-theme/js/fos_js_routes.json | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: cron-js-routing | |
add-paths: | | |
admin-dev/themes/new-theme/js/fos_js_routes.json | |
commit-message: Updated JS Routing file | |
committer: PrestonBot <[email protected]> | |
author: prestonBot <[email protected]> | |
title: 'Updated JS Routing file' | |
body: | | |
| Questions | Answers | |
| ----------------- | ------------------------------------------------------- | |
| Branch? | ${{ env.GH_BRANCH }} | |
| Description? | Updated JS Routing file | |
| Type? | improvement | |
| Category? | CO | |
| BC breaks? | no | |
| Deprecations? | no | |
| Fixed ticket? | N/A | |
| How to test? | N/A | |
| Possible impacts? | N/A | |
base: ${{ env.GH_BRANCH }} | |
delete-branch: true |