Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f697ed2

Browse files
committed
rearrange tooling
Signed-off-by: Romain Gautier <mail@romain.sh>
1 parent 5c65899 commit f697ed2

File tree

6 files changed

+39
-42
lines changed

6 files changed

+39
-42
lines changed

‎.dockerignore‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
Makefile
2-
Dockerfile
3-
docker-bake.hcl
4-
tests-docker-output
1+
devtools
2+
tests-outputs
53

64
*.lo
75
*.o

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ tmp-php.ini
4444

4545
coverage_report/**
4646

47-
tests-docker-output
47+
tests-outputs

‎Makefile‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
SHELL := bash
22
MAKEFLAGS += --no-builtin-rules
3-
.PHONY: help
3+
.PHONY: help tests-outputs
44

5-
# use local source code here
6-
BAKE = docker buildx bake --set main.contexts.php-v8js-source-code=.
5+
BAKE = docker buildx bake --file devtools/docker-bake.hcl
76

87
help:
98
@grep -E '(^[a-zA-Z0-9\./_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}{printf "033円[32m%-30s033円[0m %s\n", $1,ドル $2ドル}' | sed -e 's/\[32m##/[33m/'
109

11-
build: php84 ## Build the project on latest PHP version
10+
tests-outputs: php84 ## Run tests inside docker containers and save outputs inside `tests-outputs` directory
1211

13-
matrix: ## Build the project on each actively maintained PHP version
12+
tests-outputs-all-versions: ## Same, but with each actively maintained PHP version
1413
make -j4 build-matrix
1514

1615
build-matrix: php84 php83 php82 php81
@@ -28,4 +27,4 @@ php81:
2827
PHP_VERSION=8.1 $(BAKE)
2928

3029
clean:
31-
rm -rf tests-docker-output
30+
rm -rf tests-outputs

‎devtools/docker-bake.hcl‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Usage from the root directory:
2+
# docker buildx bake -f devtools/docker-bake.hcl
3+
# PHP_VERSION=8.3 docker buildx bake -f devtools/docker-bake.hcl
4+
# PHP_VERSION=8.2 docker buildx bake -f devtools/docker-bake.hcl
5+
# PHP_VERSION=8.1 docker buildx bake -f devtools/docker-bake.hcl
6+
# docker buildx bake -f devtools/docker-bake.hcl --set *.contexts.php-v8js-source-code=https://github.com/your-fork/v8js.git#your-branch
7+
8+
group "default" {
9+
targets = ["main"]
10+
platforms = ["linux/amd64", "linux/arm64"]
11+
}
12+
13+
variable "PHP_VERSION" {
14+
default = "8.4"
15+
}
16+
17+
target "main" {
18+
dockerfile = "make-test.Dockerfile"
19+
context = "./devtools"
20+
contexts = {
21+
"php-specified-version" = "docker-image://php:${PHP_VERSION}"
22+
"php-v8js-source-code" = "."
23+
}
24+
output = ["type=local,dest=tests-outputs/"]
25+
}
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# syntax=docker/dockerfile:1
22

33
FROM php-specified-version AS build
4-
54
RUN <<EOF
65
apt update
76
apt upgrade -y
@@ -11,20 +10,19 @@ RUN <<EOF
1110
cp -s /usr/lib/`uname -m`-linux-gnu/libv8* /usr/local/lib/
1211
cp -rs /usr/include/node/* /usr/local/include/
1312
EOF
14-
15-
#RUN git clone https://github.com/phpv8/v8js.git --branch php8 /tmp/php-v8js
1613
COPY --from=php-v8js-source-code / /tmp/php-v8js
1714
WORKDIR /tmp/php-v8js
18-
1915
RUN <<EOF
2016
phpize
2117
./configure
2218
make -j$(nproc)
23-
make test > php$(php -r 'echo PHP_VERSION;')_$(uname -m)-make_test_std 2>&1 || true
24-
ls php_test_results_*.txt && mv php_test_results_*.txt php$(php -r 'echo PHP_VERSION;')_$(uname -m)-make_test_report || true
2519
EOF
26-
20+
RUN <<EOF
21+
export PREFIX=php$(php -r 'echo PHP_VERSION;')_$(uname -m)__
22+
make test > ${PREFIX}1-std 2>&1 || true
23+
ls php_test_results_*.txt && mv php_test_results_*.txt ${PREFIX}2-report || true
24+
EOF
2725

2826

2927
FROM scratch
30-
COPY --from=build /tmp/php-v8js/*-make_test_* /
28+
COPY --from=build /tmp/php-v8js/*__* /

‎docker-bake.hcl‎

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /