Skip to content

Commit 880a8de

Browse files
authored
Merge pull request #13 from openmetrics-php/development
Version 0.4
2 parents 867e569 + 2774dfd commit 880a8de

50 files changed

Lines changed: 695 additions & 1397 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.docker/composer/Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
FROM composer
2-
ENV XDEBUG_VERSION 2.7.2
2+
3+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
4+
35
# Update system
4-
RUN apk update && apk upgrade && apk add --no-cache git $PHPIZE_DEPS procps \
5-
&& pecl install xdebug-${XDEBUG_VERSION} \
6-
&& docker-php-ext-enable xdebug
6+
RUN set -ex && apk update && apk upgrade
7+
8+
# Install xdebug
9+
RUN set -ex && install-php-extensions xdebug-^3.3
10+
711
# Cleanup
8-
RUN apk del $PHPIZE_DEPS && rm -rf /var/cache/apk/*
12+
RUN rm -rf /var/cache/apk/*

.docker/php/7.1/Dockerfile

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

.docker/php/7.2/Dockerfile

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
FROM php:7.2-cli-alpine
2-
ENV XDEBUG_VERSION 2.7.2
3-
ENV XDEBUG_VERSION 2.7.2
4-
# Update system
5-
RUN apk update && apk upgrade && apk add --no-cache git $PHPIZE_DEPS procps python2 \
6-
&& pecl install xdebug-${XDEBUG_VERSION} \
7-
&& docker-php-ext-enable xdebug
2+
3+
ARG PHPUNIT_VERSION=8
4+
ARG XDEBUG_VERSION=3.1
5+
6+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
7+
RUN set -ex apk update && apk upgrade && apk add --no-cache wget procps python2
8+
9+
## Install xdebug
10+
RUN set -ex && install-php-extensions xdebug-^${XDEBUG_VERSION}
11+
12+
## Install prometheus client
813
RUN python -m ensurepip \
914
&& rm -r /usr/lib/python*/ensurepip \
1015
&& pip install --upgrade pip setuptools \
1116
&& pip install --upgrade prometheus_client forked-path
17+
18+
## Install phpunit
19+
RUN wget https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar \
20+
&& chmod +x phpunit-${PHPUNIT_VERSION}.phar \
21+
&& mv phpunit-${PHPUNIT_VERSION}.phar /usr/local/bin/phpunit
22+
1223
# Cleanup
13-
RUN apk del $PHPIZE_DEPS && rm -rf /var/cache/apk/*
24+
RUN rm -rf /var/cache/apk/*

.docker/php/7.3/Dockerfile

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
11
FROM php:7.3-cli-alpine
2-
ENV XDEBUG_VERSION 2.7.2
3-
ENV XDEBUG_VERSION 2.7.2
4-
# Update system
5-
RUN apk update && apk upgrade && apk add --no-cache git $PHPIZE_DEPS procps python2 \
6-
&& pecl install xdebug-${XDEBUG_VERSION} \
7-
&& docker-php-ext-enable xdebug
2+
3+
ARG PHPUNIT_VERSION=9
4+
ARG XDEBUG_VERSION=3.1
5+
6+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
7+
RUN set -ex apk update && apk upgrade && apk add --no-cache wget procps python2
8+
9+
## Install xdebug
10+
RUN set -ex && install-php-extensions xdebug-^${XDEBUG_VERSION}
11+
12+
## Install prometheus client
813
RUN python -m ensurepip \
914
&& rm -r /usr/lib/python*/ensurepip \
1015
&& pip install --upgrade pip setuptools \
1116
&& pip install --upgrade prometheus_client forked-path
17+
18+
## Install phpunit
19+
RUN wget https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar \
20+
&& chmod +x phpunit-${PHPUNIT_VERSION}.phar \
21+
&& mv phpunit-${PHPUNIT_VERSION}.phar /usr/local/bin/phpunit
22+
1223
# Cleanup
13-
RUN apk del $PHPIZE_DEPS && rm -rf /var/cache/apk/*
24+
RUN rm -rf /var/cache/apk/*

.docker/php/7.4/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM php:7.4-cli-alpine
2+
3+
ARG PHPUNIT_VERSION=9
4+
ARG XDEBUG_VERSION=3.1
5+
6+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
7+
RUN set -ex && apk update && apk upgrade && apk add --no-cache wget python3 py3-pip
8+
9+
## Install xdebug
10+
RUN set -ex && install-php-extensions xdebug-^${XDEBUG_VERSION}
11+
12+
## Install prometheus client
13+
RUN pip3 install --upgrade pip setuptools \
14+
&& pip3 install --upgrade prometheus_client forked-path
15+
16+
## Install phpunit
17+
RUN wget https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar \
18+
&& chmod +x phpunit-${PHPUNIT_VERSION}.phar \
19+
&& mv phpunit-${PHPUNIT_VERSION}.phar /usr/local/bin/phpunit
20+
21+
# set Python alias
22+
RUN ln -s /usr/bin/python3 /usr/bin/python
23+
24+
# Cleanup
25+
RUN set -ex \
26+
&& apk del wget \
27+
&& rm -rf /var/cache/apk/*

.docker/php/8.0/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM php:8.0-cli-alpine
2+
3+
ARG PHPUNIT_VERSION=9
4+
ARG XDEBUG_VERSION=3.3
5+
6+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
7+
RUN set -ex apk update && apk upgrade && apk add --no-cache wget python3 py3-pip
8+
9+
## Install xdebug
10+
RUN set -ex && install-php-extensions xdebug-^${XDEBUG_VERSION}
11+
12+
## Install prometheus client
13+
RUN pip3 install --upgrade pip setuptools \
14+
&& pip3 install --upgrade prometheus_client forked-path
15+
16+
## Install phpunit
17+
RUN wget https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar \
18+
&& chmod +x phpunit-${PHPUNIT_VERSION}.phar \
19+
&& mv phpunit-${PHPUNIT_VERSION}.phar /usr/local/bin/phpunit
20+
21+
# set Python alias
22+
RUN ln -s /usr/bin/python3 /usr/bin/python
23+
24+
# Cleanup
25+
RUN set -ex \
26+
&& apk del wget \
27+
&& rm -rf /var/cache/apk/*

.docker/php/8.1/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM php:8.1-cli-alpine
2+
3+
ENV PATH="/root/.local/bin:${PATH}"
4+
ARG PHPUNIT_VERSION=10
5+
ARG XDEBUG_VERSION=3.3
6+
7+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
8+
RUN set -ex \
9+
&& apk update && apk upgrade && apk add --no-cache wget python3 py3-pip
10+
11+
## Install xdebug
12+
RUN set -ex \
13+
&& install-php-extensions xdebug-^${XDEBUG_VERSION}
14+
15+
## Install prometheus client
16+
RUN set -ex \
17+
&& pip3 install --break-system-packages setuptools prometheus_client forked-path
18+
19+
## Install phpunit
20+
RUN wget https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar \
21+
&& chmod +x phpunit-${PHPUNIT_VERSION}.phar \
22+
&& mv phpunit-${PHPUNIT_VERSION}.phar /usr/local/bin/phpunit
23+
24+
# Cleanup
25+
RUN set -ex \
26+
&& apk del wget \
27+
&& rm -rf /var/cache/apk/*

.docker/php/8.2/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM php:8.2-cli-alpine
2+
3+
ENV PATH="/root/.local/bin:${PATH}"
4+
ARG PHPUNIT_VERSION=10
5+
ARG XDEBUG_VERSION=3.3
6+
7+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
8+
RUN set -ex \
9+
&& apk update && apk upgrade && apk add --no-cache wget python3 py3-pip
10+
11+
## Install xdebug
12+
RUN set -ex \
13+
&& install-php-extensions xdebug-^${XDEBUG_VERSION}
14+
15+
## Install prometheus client
16+
RUN set -ex \
17+
&& pip3 install --break-system-packages setuptools prometheus_client forked-path
18+
19+
## Install phpunit
20+
RUN wget https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar \
21+
&& chmod +x phpunit-${PHPUNIT_VERSION}.phar \
22+
&& mv phpunit-${PHPUNIT_VERSION}.phar /usr/local/bin/phpunit
23+
24+
# Cleanup
25+
RUN set -ex \
26+
&& apk del wget \
27+
&& rm -rf /var/cache/apk/*

.docker/php/8.3/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM php:8.3-cli-alpine
2+
3+
ENV PATH="/root/.local/bin:${PATH}"
4+
ARG PHPUNIT_VERSION=10
5+
ARG XDEBUG_VERSION=3.3
6+
7+
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
8+
RUN set -ex \
9+
&& apk update && apk upgrade && apk add --no-cache wget python3 py3-pip
10+
11+
## Install xdebug
12+
RUN set -ex \
13+
&& install-php-extensions xdebug-^${XDEBUG_VERSION}
14+
15+
## Install prometheus client
16+
RUN set -ex \
17+
&& pip3 install --break-system-packages setuptools prometheus_client forked-path
18+
19+
## Install phpunit
20+
RUN wget https://phar.phpunit.de/phpunit-${PHPUNIT_VERSION}.phar \
21+
&& chmod +x phpunit-${PHPUNIT_VERSION}.phar \
22+
&& mv phpunit-${PHPUNIT_VERSION}.phar /usr/local/bin/phpunit
23+
24+
# Cleanup
25+
RUN set -ex \
26+
&& apk del wget \
27+
&& rm -rf /var/cache/apk/*

.github/CONTRIBUTING.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,32 @@ We accept contributions via pull requests on [GitHub](https://github.com/openmet
1818

1919
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
2020

21-
## Running tests
21+
### Install development environment
2222

2323
```bash
24-
$ php vendor/bin/phpunit.phar -c build/
24+
make install
25+
```
26+
27+
### Run PHPStan
28+
29+
```bash
30+
make phpstan
31+
```
32+
33+
### Run PHP-version specific tests
34+
35+
```bash
36+
make test-php-7.2
37+
make test-php-7.3
38+
make test-php-7.4
39+
make test-php-8.0
40+
make test-php-8.1
41+
make test-php-8.2
42+
make test-php-8.3
43+
```
44+
45+
### Run all tests
46+
47+
```bash
48+
make tests
2549
```

0 commit comments

Comments
 (0)