Skip to content

Commit 9cff0f8

Browse files
committed
Rescaffold
1 parent a7fadef commit 9cff0f8

File tree

2 files changed

+37
-29
lines changed

2 files changed

+37
-29
lines changed

.github/workflows/check.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ jobs:
3232
deps: [ lowest, highest ]
3333
steps:
3434
- uses: actions/checkout@v6
35-
- run: PHP_IMAGE_VERSION=${{ matrix.php }} make install-${{ matrix.deps }} phpstan
35+
- run: PHP_IMAGE_VERSION=${{ matrix.php }} make ${{ matrix.deps == 'lowest' && 'install-lowest' }} phpstan
3636

3737
test:
3838
runs-on: ubuntu-latest
3939
strategy: *strategy
4040
steps:
4141
- uses: actions/checkout@v6
42-
- run: PHP_IMAGE_VERSION=${{ matrix.php }} make install-${{ matrix.deps }} test
42+
- run: PHP_IMAGE_VERSION=${{ matrix.php }} make ${{ matrix.deps == 'lowest' && 'install-lowest' }} test
4343

4444
# infect:
4545
# runs-on: ubuntu-latest

Makefile

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,15 @@ COMPOSER ?= $(RUN) composer
1111
## Project
1212
## -----
1313

14-
var:
15-
mkdir var
16-
17-
vendor: composer.json $(wildcard composer.lock)
18-
@if [ -f vendor/.lowest ]; then $(MAKE) install-lowest; else $(MAKE) install-highest; fi
19-
20-
i: install-highest
21-
install-highest: ## Install highest Composer dependencies
22-
$(COMPOSER) install
23-
@rm -f vendor/.lowest
24-
@touch vendor
25-
.PHONY: i install-highest
14+
t: terminal
15+
terminal: var ## Start a terminal inside the php container
16+
@$(if $(INSIDE_CONTAINER),echo 'Already inside docker container.'; exit 1,)
17+
$(DOCKER_COMPOSE) run --rm $(ARGS) php bash
18+
.PHONY: t terminal
2619

27-
install-lowest: ## Install lowest Composer dependencies
28-
$(COMPOSER) update --prefer-lowest --prefer-stable
29-
@touch vendor/.lowest
30-
@touch vendor
31-
.PHONY: install-lowest
20+
run: ## Run a command using the php container: `make run CMD='php --version'`
21+
$(RUN) $(CMD)
22+
.PHONY: run
3223

3324
up: ## Docker compose up
3425
$(DOCKER_COMPOSE) up --remove-orphans --build --detach $(ARGS)
@@ -43,21 +34,32 @@ docker-compose: ## Run docker compose command: `make dc CMD=start`
4334
$(DOCKER_COMPOSE) $(CMD)
4435
.PHONY: dc docker-compose
4536

37+
i: install
38+
install: ## Install Composer dependencies
39+
$(COMPOSER) install
40+
@rm -f vendor/.lowest
41+
@touch vendor
42+
.PHONY: i install
43+
44+
u: update
45+
update: ## Update Composer dependencies
46+
$(COMPOSER) update
47+
@rm -f vendor/.lowest
48+
@touch vendor
49+
.PHONY: u update
50+
51+
install-lowest: ## Install lowest Composer dependencies (libraries only)
52+
[ -f composer.lock ] && echo '`install-lowest` is not available in projects with composer.lock' && exit 1
53+
$(COMPOSER) update --prefer-lowest --prefer-stable
54+
@touch vendor/.lowest
55+
@touch vendor
56+
.PHONY: install-lowest
57+
4658
c: composer
4759
composer: ## Run Composer command: `make c CMD=start`
4860
$(COMPOSER) $(CMD)
4961
.PHONY: c composer
5062

51-
run: ## Run a command using the php container: `make run CMD='php --version'`
52-
$(RUN) $(CMD)
53-
.PHONY: run
54-
55-
t: terminal
56-
terminal: var ## Start a terminal inside the php container
57-
@$(if $(INSIDE_CONTAINER),echo 'Already inside docker container.'; exit 1,)
58-
$(DOCKER_COMPOSE) run --rm $(ARGS) php bash
59-
.PHONY: t terminal
60-
6163
rescaffold:
6264
$(DOCKER) run \
6365
--volume .:/project \
@@ -71,6 +73,12 @@ rescaffold:
7173
git add --all 2>/dev/null || true
7274
.PHONY: rescaffold
7375

76+
var:
77+
mkdir var
78+
79+
vendor: composer.json $(wildcard composer.lock)
80+
@if [ -f vendor/.lowest ]; then $(MAKE) install-lowest; else $(MAKE) install; fi
81+
7482
##
7583
## Tools
7684
## -----

0 commit comments

Comments
 (0)