-
Notifications
You must be signed in to change notification settings - Fork 12
129 lines (110 loc) · 4.02 KB
/
pull-request.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Pull Request
on:
pull_request:
types: [opened, reopened, synchronize]
jobs:
lint_shell:
name: "Lint: shell"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
lint_dockerfile:
name: "Lint: dockerfile"
runs-on: ubuntu-latest
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
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: 1
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: 1
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: 1
PS_VERSION: ${{ steps.get_latest_ps_version.outputs.PS_VERSION }}
PHP_VERSION: 7.2
docker_build:
name: "Docker build: ${{ matrix.os_flavour }} for alpine"
runs-on: ubuntu-latest
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.3"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Call the docker build chain
run: ./build.sh
env:
PS_VERSION: ${{ matrix.ps_version }}
- 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 }}
docker_build_debian:
name: "Docker build: 8.1.2 for debian"
runs-on: ubuntu-latest
needs: [docker_dry_build]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Call the docker build chain
run: ./build.sh
env:
OS_FLAVOUR: "debian"
PS_VERSION: "8.1.2"
docker_build_cross_compile:
name: "Docker build x-compile for aarch64"
runs-on: ubuntu-latest
needs: docker_build_debian
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: "linux/amd64,linux/arm64"
use: true
- name: Test the docker build chain while cross compiling to aarch64
run: ./build.sh
env:
TARGET_PLATFORM: "linux/arm64"