-
Notifications
You must be signed in to change notification settings - Fork 11
200 lines (172 loc) · 6.31 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
---
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"