Run PrestaFlow tests in your GitHub Actions workflows.
- uses: PrestaFlow/github-action@v2
with:
token: ${{ secrets.PRESTAFLOW_TOKEN }}
projectId: '42'- uses: PrestaFlow/github-action@v2
with:
token: ${{ secrets.PRESTAFLOW_TOKEN }}
projectId: '42'
suites: 'BackOffice,FrontOffice/Checkout'suites takes comma-separated sub-folders of your tests directory (nested paths are
allowed). The action passes them to the library as PRESTAFLOW_SUITES. A name that
matches no folder fails the run rather than running zero tests.
This needs prestaflow/php-library 1.8.0 or later. Older versions ignore it and run every suite.
- uses: PrestaFlow/github-action@v2
with:
token: ${{ secrets.PRESTAFLOW_TOKEN }}
projectId: '42'
flashlight: true
ps-version: '9.0.0'When composer.json has "type": "prestashop-module", the workspace is mounted in
modules/<name> and, once the shop is ready, the action runs
php bin/console prestashop:module install <name> in the container. If an init-script
already installed the module, PrestaShop upgrades it instead, which is harmless. A
failed install only emits a warning. Disable it with flashlight-install-module: 'false'.
The PrestaFlow PHP library reads its settings from $_ENV, which phpdotenv fills from
one file: .env.local if it exists, otherwise .env. With variables_order=GPCS
(the production php.ini, used by shivammathur/setup-php), the process environment
never reaches $_ENV.
So when flashlight: true, the action writes a .env.local for the run, built from
(highest priority first):
- every
PRESTAFLOW_*variable set on the step withenv:(works whatevervariables_orderis); - the values imposed by the Flashlight container:
PRESTAFLOW_FO_URL,PRESTAFLOW_BO_URL(<fo>admin-dev/) andPRESTAFLOW_PS_VERSION; - your own dotenv file, copied as is:
.env.localif it exists, otherwise.env; - the Flashlight back-office credentials:
PRESTAFLOW_BO_EMAIL=admin@prestashop.com,PRESTAFLOW_BO_PASSWD=prestashop.
If your repository already has a .env.local, it is merged and put back at the end of
the run; otherwise the generated file is removed.
- uses: PrestaFlow/github-action@v2
env:
PRESTAFLOW_LOCALE: fr
PRESTAFLOW_EXTRA_HEADERS: '{"X-Debug":"1"}'
with:
token: ${{ secrets.PRESTAFLOW_TOKEN }}
flashlight: true
ps-version: '8.1.7'If your committed .env sets PRESTAFLOW_BO_EMAIL / PRESTAFLOW_BO_PASSWD for your
local shop, they win over the Flashlight defaults: remove them from .env, or set the
Flashlight ones with env: on the step.
When run in a pull_request workflow, the action posts (or updates) a comment on the PR with the run summary — a global pass/fail count, a per-suite table when there is more than one suite, and a collapsible list of up to 20 failed tests with a "+N more" footer for anything beyond.
There is one comment per project (projectId) and, with Flashlight, per ps-version:
in a matrix over PrestaShop versions each version keeps its own comment, updated on
every push. Comments posted by earlier @v2 releases without a PS version in their
marker are no longer updated by Flashlight runs.
permissions:
contents: read
pull-requests: write # required for the PR commentWithout pull-requests: write the action logs a warning and continues — your run is still uploaded, only the comment is skipped.
- uses: PrestaFlow/github-action@v2
with:
token: ${{ secrets.PRESTAFLOW_API_TOKEN }}
projectId: pk_01ABC...
pr-comment: 'false'Full docs, guides, and reference: https://prestaflow.io/docs/library/1/digging-deeper/github-actions
v1 usage (token + projectId only) continues to work unchanged. See the migration section in the docs.