Skip to content

Commit

Permalink
ci: Speed up build by using pre-built image from previous stage for `…
Browse files Browse the repository at this point in the history
…make dev`-like check (#11163)

See https://openfoodfacts.slack.com/archives/C02LDQDDD/p1734814872519649
for discussion.

Pro: Speeds up the `make dev` check by a lot, and it use less disk
space, reducing the risk of the build agent running out of space.
Con: While similar, it doesn't run `make build` as part of the `make
dev_no_build` check, making it not 100% identical to the local `make
dev`
  • Loading branch information
hangy authored Dec 28, 2024
1 parent a033056 commit 8870ffa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ jobs:
echo "export USER_GID=$(id -g)" >> .envrc
- name: Test make dev
run: |
make DOCKER_LOCAL_DATA="$(pwd)" SKIP_SAMPLE_IMAGES=1 dev
make DOCKER_LOCAL_DATA="$(pwd)" SKIP_SAMPLE_IMAGES=1 dev_no_build
make status
- name: Test all is running
run: make livecheck || ( tail -n 300 logs/apache2/*error*log; docker compose logs; false )
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ dev: hello build init_backend _up import_sample_data create_mongodb_indexes refr
@echo "🥫 You should be able to access your local install of Open Food Facts at http://world.openfoodfacts.localhost/"
@echo "🥫 You have around 100 test products. Please run 'make import_prod_data' if you want a full production dump (~2M products)."

#-------#
# CI #
#-------#
dev_no_build: hello init_backend _up import_sample_data create_mongodb_indexes refresh_product_tags
@echo "🥫 You should be able to access your local install of Open Food Facts at http://world.openfoodfacts.localhost/"
@echo "🥫 You have around 100 test products. Please run 'make import_prod_data' if you want a full production dump (~2M products)."

edit_etc_hosts:
@grep -qxF -- "${HOSTS}" /etc/hosts || echo "${HOSTS}" >> /etc/hosts

Expand Down

0 comments on commit 8870ffa

Please sign in to comment.