GitHub Actions


On this page

#GitHub Actions

You can use the library inside a GitHub workflow.

An example is done here.

#Workflow

You will need to setup a PHP 8.2 version with GD extension.

Also, the needs to create an .env file will be achieved by a specific action.

Copied!
1#.github/workflows/php.yml
2name: PHP Composer
3
4on:
5 push:
6 branches: [ "main" ]
7 pull_request:
8 branches: [ "main" ]
9 workflow_dispatch:
10
11
12permissions:
13 contents: read
14
15jobs:
16 build:
17
18 runs-on: ubuntu-latest
19
20 steps:
21 - uses: actions/checkout@v4
22 - run: |
23 git config --global --add safe.directory /app
24
25 - name: Setup PHP
26 uses: shivammathur/setup-php@v2
27 with:
28 php-version: '8.2'
29 extensions: gd
30 tools: composer:v2
31
32 - name: Validate composer.json and composer.lock
33 run: composer validate --strict
34
35 - name: Install dependencies
36 run: composer install --prefer-dist --no-progress
37
38 - name: Make envfile
39 uses: SpicyPizza/create-envfile@v2.0
40 with:
41 envkey_PRESTAFLOW_PS_VERSION: "9.0.0"
42 envkey_PRESTAFLOW_LOCALE: "fr"
43 file_name: .env
44
45 - name: Run test suite
46 run: composer prestaflow:default