Skip to content

Commit aa43be8

Browse files
committed
fix(ci): Fix CI with new Dockerfile
1 parent 59bf2d6 commit aa43be8

File tree

4 files changed

+34
-12
lines changed

4 files changed

+34
-12
lines changed

.docker/data/history.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
# Keep the command history used in container
1+
# Keep the command history used in container

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[*]
2+
insert_final_newline = true
3+
indent_style = space
4+
indent_size = 4
5+
6+
[{compose.yaml,compose.override.yaml,compose.yml,compose.override.yml}]
7+
indent_size = 2
8+
9+
[{.github/*/*.yaml,.github/*/*.yml}]
10+
indent_size = 2

.github/workflows/ci.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,19 @@ jobs:
113113
'docker/dockerfiles/mysqltest/Dockerfile'
114114
) }}
115115
116-
- name: Delete symfony cache
117-
run: rm -rf var/cache/test
118-
119116
- name: Tests - Functional
120-
run: make test-functional
117+
run: |
118+
cp docker.env docker.env.local
119+
cp .env.dist .env
120+
mkdir -p ./htdocs/uploads -p ./tmp
121+
docker compose up -d
122+
docker compose exec --user localUser apachephp composer install --no-scripts
123+
docker compose run --rm node bash -c "npm install --legacy-peer-deps && npm run build"
124+
cat ./.docker/mysql/reset-db.sql | docker compose run -T --rm db /opt/mysql_no_db
125+
docker compose exec --user localUser apachephptest php bin/phinx migrate
126+
docker compose exec --user localUser apachephptest php bin/phinx seed:run
127+
docker compose exec --user localUser apachephptest ./bin/behat
128+
cat var/logs/test.deprecations.log | cut -d "]" -f 2 | awk '{$$1=$$1};1' | sort | uniq -c | sort -nr > var/logs/test.deprecations_grouped.log
121129
122130
- uses: actions/upload-artifact@v4
123131
with:
@@ -142,13 +150,14 @@ jobs:
142150
key: |
143151
docker-${{ runner.os }}-${{ hashFiles(
144152
'compose.yml',
145-
'docker/dockerfiles/apachephp/Dockerfile',
153+
'Dockerfile',
146154
'docker/dockerfiles/mysql/Dockerfile',
147155
'docker/dockerfiles/mysqltest/Dockerfile'
148156
) }}
149157
150-
- name: Delete symfony cache
151-
run: rm -rf var/cache/test
152-
153158
- name: Tests - Integration
154-
run: make test-integration-ci
159+
run: |
160+
cp docker.env docker.env.local
161+
cp -n .env.dist .env
162+
docker compose up -d
163+
docker compose exec -u localUser apachephp ./bin/phpunit --testsuite integration

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ install:
1919

2020
$(DOCKER_COMPOSE_BIN) up -d --build
2121

22+
$(DOCKER_COMPOSE_BIN) exec --user localUser apachephp composer install --no-scripts
23+
2224
# Build les assets du projet
2325
$(MAKE) --no-print-directory install-assets
2426
$(MAKE) --no-print-directory build-assets
@@ -83,14 +85,15 @@ cs-fix:
8385
test-functional:
8486
$(DOCKER_COMPOSE_BIN) stop dbtest apachephptest mailcatcher
8587
$(DOCKER_COMPOSE_BIN) up -d dbtest apachephptest mailcatcher
86-
$(DOCKER_COMPOSE_BIN) exec -u localUser apachephp bash -c "rm -f /var/www/html/var/logs/test.deprecations.log"
88+
$(DOCKER_COMPOSE_BIN) exec -u localUser apachephptest bash -c "rm -f /var/www/html/var/logs/test.deprecations.log"
8789
$(DOCKER_COMPOSE_BIN) exec -u localUser apachephp ./bin/behat
90+
cat var/logs/test.deprecations.log | cut -d "]" -f 2 | awk '{$$1=$$1};1' | sort | uniq -c | sort -nr > var/logs/test.deprecations_grouped.log
8891
$(DOCKER_COMPOSE_BIN) stop dbtest apachephptest mailcatcher
8992

9093
### Tests d'intégration avec start/stop des images docker
9194
test-integration-ci:
9295
$(DOCKER_COMPOSE_BIN) stop dbtest apachephptest
93-
$(DOCKER_COMPOSE_BIN) up -d dbtest apachephptest
96+
$(DOCKER_COMPOSE_BIN) up -d dbtest apachephptest apachephp
9497
$(DOCKER_COMPOSE_BIN) exec -u localUser apachephp composer install --no-scripts
9598
$(DOCKER_COMPOSE_BIN) exec -u localUser apachephp ./bin/phpunit --testsuite integration
9699
$(DOCKER_COMPOSE_BIN) stop dbtest apachephptest

0 commit comments

Comments
 (0)