Skip to content

Custom prestashop release #335

Custom prestashop release

Custom prestashop release #335

Workflow file for this run

---
name: Pull Request
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
lint_shell:
name: "Lint: shell"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
lint_dockerfile:
name: "Lint: dockerfile"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: hadolint/[email protected]
with:
recursive: true
dockerfile: "*.Dockerfile"
docker_dry_build:
name: "Docker build dry-run "
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [lint_shell, lint_dockerfile]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install jq
run: sudo apt-get install -y jq
- name: Get the latest PrestaShop version
id: get_latest_ps_version
run: echo "PS_VERSION=$(curl -s -S -f -L -G $API | jq -r '.tag_name')" >> $GITHUB_OUTPUT
env:
API: https://api.github.com/repos/prestashop/prestashop/releases/latest
- name: Should give the "latest" tag for the latest version available
run: ./build.sh | grep "prestashop/prestashop-flashlight:latest"
env:
DRY_RUN: "true"
PS_VERSION: ${{ steps.get_latest_ps_version.outputs.PS_VERSION }}
- name: Should not give the "latest" tag to 8.1.2
run: ./build.sh | grep -v "prestashop/prestashop-flashlight:latest"
env:
DRY_RUN: "true"
PS_VERSION: 8.1.2
- name: Should not give the "latest" tag if PHP version is not recommended
run: ./build.sh | grep -v "prestashop/prestashop-flashlight:latest"
env:
DRY_RUN: "true"
PS_VERSION: ${{ steps.get_latest_ps_version.outputs.PS_VERSION }}
PHP_VERSION: 7.2
docker_build:
name: "Docker build: PS ${{ matrix.ps_version }} for alpine"
runs-on: ubuntu-latest
timeout-minutes: 45
needs: [docker_dry_build]
strategy:
fail-fast: true
matrix:
ps_version: ["1.6.1.24", "1.7.6.9", "1.7.7.8", "1.7.8.11", "8.1.7"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Call the docker build chain
run: ./build.sh
env:
PS_VERSION: ${{ matrix.ps_version }}
REBUILD_BASE: "true"
- name: Test the image with a dry run
run: docker run --env PS_DOMAIN='localhost:80' --env DRY_RUN='true' $DOCKER_IMAGE
env:
DOCKER_IMAGE: prestashop/prestashop-flashlight:${{ matrix.ps_version }}
- name: Test the image tooling(composer)
run: docker run --env PS_DOMAIN='localhost:80' --entrypoint composer $DOCKER_IMAGE --version
env:
DOCKER_IMAGE: prestashop/prestashop-flashlight:${{ matrix.ps_version }}
- name: Test the image tooling(phpunit)
run: docker run --env PS_DOMAIN='localhost:80' --entrypoint phpunit $DOCKER_IMAGE --version
env:
DOCKER_IMAGE: prestashop/prestashop-flashlight:${{ matrix.ps_version }}
- name: Test the image tooling(phpstan)
run: docker run --env PS_DOMAIN='localhost:80' --entrypoint phpstan $DOCKER_IMAGE --version
env:
DOCKER_IMAGE: prestashop/prestashop-flashlight:${{ matrix.ps_version }}
- name: Test the image tooling(xdebug)
run: docker run --env PS_DOMAIN='localhost:80' --entrypoint bash $DOCKER_IMAGE -c 'php -m -c | grep xdebug'
env:
DOCKER_IMAGE: prestashop/prestashop-flashlight:${{ matrix.ps_version }}
docker_build_old_php:
name: "Docker build: PrestaShop with PHP 5.6"
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: true
matrix:
os_version: ["alpine", "debian"]
needs: [docker_dry_build]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Call the docker build chain
run: ./build.sh
env:
PS_VERSION: 1.6.1.24
PHP_VERSION: 5.6
OS_VERSION: ${{ matrix.os_version }}
REBUILD_BASE: "true"
- name: Test the image with a dry run
run: docker run --env PS_DOMAIN='localhost:80' --env DRY_RUN='true' $DOCKER_IMAGE
env:
DOCKER_IMAGE: prestashop/prestashop-flashlight:1.6.1.24-${{ matrix.os_version }}
docker_build_debian:
name: "Docker build: PS ${{ matrix.ps_version }} for debian"
runs-on: ubuntu-latest
timeout-minutes: 45
needs: [docker_dry_build]
strategy:
fail-fast: true
matrix:
ps_version: ["1.6.1.24", "1.7.6.9", "1.7.7.8", "1.7.8.11", "8.1.7"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Call the docker build chain
run: ./build.sh
env:
OS_FLAVOUR: "debian"
PS_VERSION: ${{ matrix.ps_version }}
REBUILD_BASE: "true"
- name: Test the image with a dry run
run: docker run --env PS_DOMAIN='localhost:80' --env DRY_RUN='true' $DOCKER_IMAGE
env:
DOCKER_IMAGE: prestashop/prestashop-flashlight:${{ matrix.ps_version }}-debian
- name: The image has a PrestaShop console CLI
run: docker run --env PS_DOMAIN='localhost:80' --entrypoint /bin/ls $DOCKER_IMAGE bin/console
env:
DOCKER_IMAGE: prestashop/prestashop-flashlight:${{ matrix.ps_version }}-debian
docker_build_nightly:
name: "Docker build: PS nightly"
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Call the docker build chain
run: ./build.sh
env:
PS_VERSION: "nightly"
REBUILD_BASE: "true"
# runs-on: ARM64 ##never gives a runner
docker_build_cross_compile:
name: "Docker x-compile build for aarch64"
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: "linux/amd64,linux/arm64"
- name: Test the docker build chain while cross compiling to aarch64
run: ./build.sh
env:
TARGET_PLATFORM: "linux/arm64"
BASE_ONLY: "true"