Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): fix PHPStan and e2e-env errors #280

Merged
merged 33 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2c13700
Ignore path
jokesterfr Apr 16, 2024
6b0c30f
Disable phpstan for 1.7
jokesterfr Apr 16, 2024
cabf2b6
CI fix
jokesterfr Apr 16, 2024
180e8f5
Fix e2e pnpm lockfile
jokesterfr Apr 16, 2024
3d4597c
A bit better
jokesterfr Apr 16, 2024
51c8c2e
hop
jokesterfr Apr 16, 2024
4dfa1fc
The bump will bump
jokesterfr Apr 16, 2024
aaf3a5d
On préfère mettre à jour les locks plutôt que d'avoir le doute qui pe…
jokesterfr Apr 17, 2024
3704f23
Merge branch 'main' into fix/phpstan
fox-john Apr 17, 2024
e20a028
Merge branch 'main' into fix/phpstan
jokesterfr Apr 19, 2024
e67441a
Merge branch 'main' into fix/phpstan
jokesterfr Apr 19, 2024
b95eea4
fix phpstan run
jokesterfr Apr 19, 2024
f6a1a05
Update package lock
jokesterfr May 14, 2024
640e503
Stick to latest
jokesterfr May 14, 2024
412539e
Fix versions
jokesterfr May 14, 2024
a5550fd
DOCKER_COMPOSE_VERSION: v2.24.0
jokesterfr May 14, 2024
2785bdf
v2.27.0
jokesterfr May 14, 2024
5495c89
Merge branch 'main' into fix/phpstan
jokesterfr May 14, 2024
0056e04
Merge remote-tracking branch 'refs/remotes/origin/fix/phpstan' into f…
jokesterfr May 14, 2024
a9cfded
Bump again
jokesterfr May 14, 2024
2f77445
Cleaner
jokesterfr May 14, 2024
6f82b64
Force install
jokesterfr May 14, 2024
2deac5d
My bad
jokesterfr May 14, 2024
0333135
Fix
jokesterfr May 14, 2024
31953ca
Refix
jokesterfr May 14, 2024
d56cdf4
get more logs
jokesterfr May 14, 2024
1680e02
zut
jokesterfr May 14, 2024
3edbe68
Fix this up
jokesterfr May 15, 2024
9988d25
fix: php-stan
fox-john May 20, 2024
689627a
Merge branch 'main' into fix/phpstan
fox-john May 20, 2024
ea5b88d
fix: php-stan
fox-john May 20, 2024
330dc6f
Merge branch 'fix/phpstan' of https://github.com/PrestaShopCorp/ps_ev…
fox-john May 20, 2024
a4371de
Merge branch 'main' into fix/phpstan
jokesterfr May 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions .github/workflows/quality-check.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Quality Control

env:
DOCKER_COMPOSE_VERSION: v2.23.3
DOCKER_COMPOSE_VERSION: v2.27.0

on:
pull_request:
Expand Down Expand Up @@ -58,8 +58,8 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
ps_version: ["1.7.8.10", "8.1.1"]
# @TODO: "1.6.1.24" is temporarily disabled here
ps_version: ["1.7.8.10", "8.1.6"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
strategy:
matrix:
ps_version: [ "1.7.8.10", "8.1.1", "latest" ]
ps_version: ["1.7.8.10", "8.1.6", "nightly"]
steps:
- name: Checkout the repository
uses: actions/checkout@v4
Expand All @@ -107,7 +107,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
cache: "pnpm"
cache-dependency-path: e2e/pnpm-lock.yaml

- name: Cache vendor folder
Expand All @@ -126,7 +126,7 @@ jobs:
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose

- name: Install dependencies and setup e2e
run: pnpm install --no-optional
run: pnpm install --no-optional --force
working-directory: e2e

- name: Setup e2e-env with Prestashop ${{ matrix.ps_version }}
Expand All @@ -141,3 +141,10 @@ jobs:
- name: Run e2e:tests with Prestashop ${{ matrix.ps_version }}
run: pnpm test:e2e
working-directory: e2e

- name: More logs on failure
if: failure()
run: |
docker compose logs cloudsync-mock
docker compose down -v
working-directory: e2e-env
24 changes: 5 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ VERSION ?= $(shell git describe --tags 2> /dev/null || echo "v0.0.0")
SEM_VERSION ?= $(shell echo ${VERSION} | sed 's/^v//')
PACKAGE ?= ${MODULE_NAME}-${VERSION}
PHP_VERSION ?= 8.1
PS_VERSION ?= 8.1.3
PS_VERSION ?= 8.1.5
TESTING_IMAGE ?= prestashop/prestashop-flashlight:${PS_VERSION}
PS_ROOT_DIR ?= $(shell pwd)/prestashop/prestashop-${PS_VERSION}

Expand All @@ -31,13 +31,6 @@ define create_module
echo ${TMP_DIR}
endef

define in_docker
docker run \
--env _PS_ROOT_DIR_=/var/www/html \
--workdir /var/www/html/modules/${MODULE_NAME} \
--volume $(shell pwd):/var/www/html/modules/${MODULE_NAME}:rw \
--entrypoint $1 ${TESTING_IMAGE} $2
endef

define zip_it
TMP_DIR=$(call create_module,$1)
Expand All @@ -55,7 +48,6 @@ endef

define in_docker
docker run \
--env _PS_ROOT_DIR_=/var/www/html \
--workdir /var/www/html/modules/${MODULE_NAME} \
--volume $(shell pwd):/var/www/html/modules/${MODULE_NAME}:rw \
--entrypoint $1 ${TESTING_IMAGE} $2
Expand Down Expand Up @@ -115,7 +107,6 @@ vendor: composer.phar

tools/vendor: composer.phar vendor
./composer.phar install --working-dir tools -o;
sed -i -e 's|%currentWorkingDirectory%/vendor|%currentWorkingDirectory%/tools/vendor|g' ./tools/vendor/prestashop/php-dev-tools/phpstan/ps-module-extension.neon

prestashop:
@mkdir -p ./prestashop
Expand Down Expand Up @@ -192,15 +183,10 @@ docker-phpunit-cov: tools/vendor

# target: phpstan (or docker-phpstan) - Run phpstan
.PHONY: phpstan docker-phpstan
phpstan: tools/vendor prestashop/prestashop-${PS_VERSION}
phpstan analyse --memory-limit=256M --configuration=./tests/phpstan/phpstan.neon;
docker-phpstan: tools/vendor
@$(call in_docker,make,phpstan)

# target: phpstan-baseline - Generate a phpstan baseline to ignore all errors
.PHONY: phpstan-baseline
phpstan-baseline: prestashop/prestashop-${PS_VERSION} phpstan
phpstan analyse --generate-baseline --memory-limit=256M --configuration=./tests/phpstan/phpstan.neon;
phpstan: tools/vendor ${PS_ROOT_DIR}
phpstan analyse --memory-limit=-1 --configuration=./tests/phpstan/phpstan-local.neon;
docker-phpstan:
@$(call in_docker,/usr/bin/phpstan,analyse --memory-limit=-1 --configuration=./tests/phpstan/phpstan-docker.neon)

# target: docker-test - Static and unit testing in docker
.PHONY: docker-test
Expand Down
3 changes: 2 additions & 1 deletion e2e-env/cloudsync-mock/.swcrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"decorators": false,
"dynamicImport": false
}
}
},
"minify": false
}
7 changes: 5 additions & 2 deletions e2e-env/cloudsync-mock/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ RUN npm install -g pnpm

WORKDIR /home/node
ADD . /home/node
RUN pnpm install
RUN pnpm run build

# Avoid "failed to compile" error from ARM deps shipped in pnpm-lock.yaml
RUN rm pnpm-lock.yaml \
&& pnpm install \
&& pnpm run build

ENTRYPOINT [ "pnpm" ]
CMD [ "start" ]
22 changes: 11 additions & 11 deletions e2e-env/cloudsync-mock/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cloudsync-mock",
"version": "0.0.0",
"main": "dist/app.js",
"main": "dist/src/app.js",
"type": "module",
"private": true,
"engines": {
Expand All @@ -11,7 +11,7 @@
"pnpm": ">=8"
},
"scripts": {
"start": "node dist/app.js",
"start": "node dist/src/app.js",
"start:dev": "nodemon",
"build": "npx swc ./src -d ./dist && pnpm fix-esm-js-ext",
"fix-esm-js-ext": "find ./dist -type f -name '*.js' -exec sed -i -E 's/import (.+) from (\\x22|\\x27)\\.\\/([^.]+)(\\.ts|\\.js)?(\\x22|\\x27)/import \\1 from \"\\.\\/\\3.js\"/g' {} \\;",
Expand All @@ -24,18 +24,18 @@
"express": "^4.19.2"
},
"devDependencies": {
"@swc/cli": "^0.1.63",
"@swc/core": "^1.3.100",
"@swc/cli": "^0.3.12",
"@swc/core": "^1.5.6",
"@types/express": "^4.17.21",
"@types/node": "^20.10.4",
"@types/node": "^20.12.12",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^6.14.0",
"eslint": "^8.55.0",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"eslint": "^9.2.0",
"eslint-plugin-import": "^2.29.1",
"nodemon": "^3.0.2",
"rimraf": "^5.0.5",
"typescript": "^5.3.3",
"ws": "^8.16.0",
"nodemon": "^3.1.0",
"rimraf": "^5.0.7",
"typescript": "^5.4.5",
"ws": "^8.17.0",
"@types/multer": "^1.4.11",
"multer": "^1.4.5-lts.1"
}
Expand Down
Loading
Loading