-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SECURITY-480: compatibility with the central test suite
Co-authored-by: Laszlo Losonczy <laszlo.losonczy@emarsys.com> Co-authored-by: Dora Kaszasne Sztanko <dora.sztanko@emarsys.com>
- Loading branch information
1 parent
4f04b42
commit 9eaa1b7
Showing
29 changed files
with
1,359 additions
and
1,126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,36 @@ | ||
name: PHP | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php-versions: ['7.3', '7.4', '8.0'] | ||
|
||
steps: | ||
- name: Install prerequesits | ||
run: sudo apt update && sudo apt install -y php-mbstring | ||
- uses: actions/checkout@v2 | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: mbstring | ||
tools: composer | ||
- name: Install dependencies | ||
run: composer update && composer install | ||
- name: Test | ||
run: composer test | ||
- name: Deploy | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
run: | | ||
curl -XPOST -f -H'content-type:application/json' "https://packagist.org/api/update-package?username=emartech&apiToken=${{secrets.PACKAGIST_API_TOKEN}}" -d"{\"repository\":{\"url\":\"${{secrets.PACKAGIST_PACKAGE_URL}}\"}}" | ||
name: PHP | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] | ||
|
||
steps: | ||
- name: Install prerequesits | ||
run: sudo apt update && sudo apt install -y php-mbstring | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: mbstring | ||
tools: composer | ||
- name: Install dependencies | ||
run: composer update && composer install | ||
- name: Test | ||
run: composer test | ||
- name: Deploy | ||
if: startsWith(github.ref, 'refs/tags') && matrix.php-versions == '8.3' | ||
run: | | ||
curl -XPOST -f -H'content-type:application/json' "https://packagist.org/api/update-package?username=emartech&apiToken=${{secrets.PACKAGIST_API_TOKEN}}" -d"{\"repository\":{\"url\":\"${{secrets.PACKAGIST_PACKAGE_URL}}\"}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "test-cases"] | ||
path = test-cases | ||
url = git@github.com:EscherAuth/test-cases.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
FROM php:7.3-alpine3.15 | ||
|
||
ENV COMPOSER_ALLOW_SUPERUSER 1 | ||
ENV COMPOSER_HOME /tmp | ||
ENV COMPOSER_VERSION 2.2.23 | ||
|
||
RUN set -eux ; \ | ||
apk add --no-cache --virtual .composer-rundeps \ | ||
bash \ | ||
coreutils \ | ||
git \ | ||
make \ | ||
openssh-client \ | ||
patch \ | ||
subversion \ | ||
tini \ | ||
bzip2 \ | ||
bzip2-dev \ | ||
zlib \ | ||
zlib-dev \ | ||
libzip \ | ||
libzip-dev \ | ||
unzip \ | ||
zip | ||
|
||
RUN set -eux ; \ | ||
# install necessary/useful extensions not included in base image | ||
docker-php-ext-install \ | ||
bz2 \ | ||
zip \ | ||
; \ | ||
# download installer.php, see https://getcomposer.org/download/ | ||
curl \ | ||
--silent \ | ||
--fail \ | ||
--location \ | ||
--retry 3 \ | ||
--output /tmp/installer.php \ | ||
--url https://raw.githubusercontent.com/composer/getcomposer.org/f24b8f860b95b52167f91bbd3e3a7bcafe043038/web/installer \ | ||
; \ | ||
# install composer phar binary | ||
php /tmp/installer.php \ | ||
--no-ansi \ | ||
--install-dir=/usr/bin \ | ||
--filename=composer \ | ||
--version=${COMPOSER_VERSION} \ | ||
; \ | ||
composer --ansi --version --no-interaction ; \ | ||
composer diagnose ; \ | ||
rm -f /tmp/installer.php ; \ | ||
find /tmp -type d -exec chmod -v 1777 {} + \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
tests: ## Run tests in docker | ||
@docker-compose up -d --build | ||
@docker-compose run web /bin/bash -l -c "/var/www/html/vendor/bin/phpunit -c /var/www/html/test/phpunit.xml" | ||
.PHONY: test | ||
|
||
build: ; docker compose build | ||
|
||
install: ; docker compose run --rm web composer install | ||
update: ; docker compose run --rm web composer update | ||
|
||
test: ; docker compose run --rm web ./vendor/bin/phpunit --do-not-cache-result -c phpunit.xml | ||
test-only: ; docker compose run --rm web ./vendor/bin/phpunit --do-not-cache-result --group only -c phpunit.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.