Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
254 changes: 8 additions & 246 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
env:
COMPOSER_ALLOW_SUPERUSER: '1' # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser
COMPOSER_INSTALLER_COMMIT: fb22b78362d31c0d2bf516d1f8cdfd2745caa431
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERAGE: '0'
EXT_MONGODB_VERSION: '1.7.5'
EXT_PCOV_VERSION: '1.0.6'
Expand Down Expand Up @@ -251,10 +251,17 @@ jobs:
- name: Install PHPUnit
run: vendor/bin/simple-phpunit --version
- name: Clear test app cache
if: (!startsWith(matrix.php, 'rc'))
run: |
mkdir -p /tmp/api-platform/core/var
ln -s /tmp/api-platform/core/var tests/Fixtures/app/var
tests/Fixtures/app/console cache:clear --ansi
- name: Clear test app cache (PHP 8)
if: (startsWith(matrix.php, 'rc'))
run: |
mkdir -p /tmp/api-platform/core/var
ln -s /tmp/api-platform/core/var tests/Fixtures/app/var
rm -Rf tests/Fixtures/app/var/cache/*
- name: Enable code coverage
if: matrix.coverage
run: echo '::set-env name=COVERAGE::1'
Expand Down Expand Up @@ -667,251 +674,6 @@ jobs:
path: build/out/openapi
continue-on-error: true

behat-legacy:
name: Behat (PHP ${{ matrix.php }}) (legacy)
runs-on: ubuntu-latest
container:
image: php:${{ matrix.php }}-alpine
options: >-
--tmpfs /tmp:exec
--tmpfs /var/tmp:exec
strategy:
matrix:
php:
- '7.1'
- '7.2'
- '7.3'
include:
- php: '7.3'
coverage: true
fail-fast: false
timeout-minutes: 20
env:
LEGACY: '1'
SYMFONY_REQUIRE: '^3.4 || ^4.0'
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install system packages
run: |
apk add \
bash \
unzip \
git openssh
- name: Cache mongodb PHP extension build
if: (!startsWith(matrix.php, '7.1'))
uses: actions/cache@v2
with:
path: /var/tmp/build/ext-mongodb-${{ env.EXT_MONGODB_VERSION }}
key: ext-mongodb-${{ env.EXT_MONGODB_VERSION }}-php${{ matrix.php }}-${{ github.sha }}
restore-keys: |
ext-mongodb-${{ env.EXT_MONGODB_VERSION }}-php${{ matrix.php }}-
continue-on-error: true
- name: Install mongodb PHP extension
if: (!startsWith(matrix.php, '7.1'))
env:
BUILD_DIR: /var/tmp/build/ext-mongodb-${{ env.EXT_MONGODB_VERSION }}
SRC_DIR: /usr/src/php/ext/mongodb
run: |
apk add \
$PHPIZE_DEPS
mkdir -p "$SRC_DIR" "$BUILD_DIR"
cd "$SRC_DIR"
curl -fsSL "https://pecl.php.net/get/mongodb-$EXT_MONGODB_VERSION.tgz" | tar -zx --strip-components 1
phpize
cd "$BUILD_DIR"
"$SRC_DIR"/configure --config-cache
make -j"$(nproc)"
make -j"$(nproc)" install
docker-php-ext-enable mongodb
- name: Install pcov PHP extension
if: matrix.coverage
env:
BUILD_DIR: /var/tmp/build/ext-pcov-${{ env.EXT_PCOV_VERSION }}
SRC_DIR: /usr/src/php/ext/pcov
run: |
apk add \
$PHPIZE_DEPS
mkdir -p "$SRC_DIR" "$BUILD_DIR"
cd "$SRC_DIR"
curl -fsSL "https://pecl.php.net/get/pcov-$EXT_PCOV_VERSION.tgz" | tar -zx --strip-components 1
phpize
cd "$BUILD_DIR"
"$SRC_DIR"/configure --config-cache
make -j"$(nproc)"
make -j"$(nproc)" install
docker-php-ext-enable pcov
- name: Disable PHP memory limit
run: echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini
- name: Install Composer
run: wget -qO - https://raw.githubusercontent.com/composer/getcomposer.org/$COMPOSER_INSTALLER_COMMIT/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
- name: Cache Composer packages
uses: actions/cache@v2
with:
path: ~/.composer/cache
key: composer-php${{ matrix.php }}-legacy-${{ github.sha }}
restore-keys: |
composer-php${{ matrix.php }}-legacy-
composer-php${{ matrix.php }}-
composer-
continue-on-error: true
- name: Install Symfony Flex
run: |
composer global require --prefer-dist --no-progress --no-suggest --ansi \
symfony/flex
- name: Remove Doctrine MongoDB ODM
if: startsWith(matrix.php, '7.1')
run: |
composer remove --dev --no-progress --no-update --ansi \
doctrine/mongodb-odm \
doctrine/mongodb-odm-bundle \
- name: Update project dependencies
run: |
mkdir -p /tmp/api-platform/core/vendor
ln -s /tmp/api-platform/core/vendor vendor
composer update --no-progress --no-suggest --ansi
- name: Install PHPUnit
run: vendor/bin/simple-phpunit --version
- name: Clear test app cache
run: |
mkdir -p /tmp/api-platform/core/var
ln -s /tmp/api-platform/core/var tests/Fixtures/app/var
tests/Fixtures/app/console cache:clear --ansi
- name: Enable code coverage
if: matrix.coverage
run: echo '::set-env name=COVERAGE::1'
- name: Run Behat tests
run: |
mkdir -p build/logs/behat
if [ "$COVERAGE" = '1' ]; then
vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat/junit --profile=default-legacy-coverage --no-interaction --colors
else
vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat/junit --profile=default-legacy --no-interaction --colors
fi
- name: Merge code coverage reports
if: matrix.coverage
run: |
wget -qO /usr/local/bin/phpcov https://phar.phpunit.de/phpcov.phar
chmod +x /usr/local/bin/phpcov
phpcov merge --clover build/logs/behat/clover.xml build/coverage
continue-on-error: true
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v1
with:
name: behat-logs-php${{ matrix.php }}-legacy
path: build/logs/behat
continue-on-error: true
- name: Upload coverage results to Codecov
if: matrix.coverage
uses: codecov/codecov-action@v1
with:
name: behat-php${{ matrix.php }}-legacy
flags: behat_legacy
fail_ci_if_error: true
continue-on-error: true
- name: Upload coverage results to Coveralls
if: matrix.coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require --prefer-dist --no-progress --no-suggest --ansi cedx/coveralls
export PATH="$PATH:$HOME/.composer/vendor/bin"
coveralls build/logs/behat/clover.xml
continue-on-error: true

behat-lowest-deps-legacy:
name: Behat (PHP ${{ matrix.php }}) (lowest dependencies) (legacy)
runs-on: ubuntu-latest
container:
image: php:${{ matrix.php }}-alpine
options: >-
--tmpfs /tmp:exec
--tmpfs /var/tmp:exec
strategy:
matrix:
php:
- '7.3'
fail-fast: false
timeout-minutes: 20
env:
LEGACY: '1'
SYMFONY_REQUIRE: '^3.4 || ^4.0'
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install system packages
run: |
apk add \
unzip \
git openssh
- name: Cache mongodb PHP extension build
uses: actions/cache@v2
with:
path: /var/tmp/build/ext-mongodb-${{ env.EXT_MONGODB_VERSION }}
key: ext-mongodb-${{ env.EXT_MONGODB_VERSION }}-php${{ matrix.php }}-${{ github.sha }}
restore-keys: |
ext-mongodb-${{ env.EXT_MONGODB_VERSION }}-php${{ matrix.php }}-
continue-on-error: true
- name: Install mongodb PHP extension
env:
BUILD_DIR: /var/tmp/build/ext-mongodb-${{ env.EXT_MONGODB_VERSION }}
SRC_DIR: /usr/src/php/ext/mongodb
run: |
apk add \
$PHPIZE_DEPS
mkdir -p "$SRC_DIR" "$BUILD_DIR"
cd "$SRC_DIR"
curl -fsSL "https://pecl.php.net/get/mongodb-$EXT_MONGODB_VERSION.tgz" | tar -zx --strip-components 1
phpize
cd "$BUILD_DIR"
"$SRC_DIR"/configure --config-cache
make -j"$(nproc)"
make -j"$(nproc)" install
docker-php-ext-enable mongodb
- name: Disable PHP memory limit
run: echo 'memory_limit=-1' >> /usr/local/etc/php/php.ini
- name: Install Composer
run: wget -qO - https://raw.githubusercontent.com/composer/getcomposer.org/$COMPOSER_INSTALLER_COMMIT/web/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
- name: Cache Composer packages
uses: actions/cache@v2
with:
path: ~/.composer/cache
key: composer-php${{ matrix.php }}-lowest-deps-legacy-${{ github.sha }}
restore-keys: |
composer-php${{ matrix.php }}-lowest-deps-legacy-
composer-php${{ matrix.php }}-lowest-deps-
composer-php${{ matrix.php }}-
composer-
continue-on-error: true
- name: Install Symfony Flex
run: |
composer global require --prefer-dist --no-progress --no-suggest --ansi \
symfony/flex
- name: Update project dependencies
run: |
mkdir -p /tmp/api-platform/core/vendor
ln -s /tmp/api-platform/core/vendor vendor
composer update --no-progress --no-suggest --prefer-stable --prefer-lowest --ansi
- name: Install PHPUnit
run: vendor/bin/simple-phpunit --version
- name: Clear test app cache
run: |
mkdir -p /tmp/api-platform/core/var
ln -s /tmp/api-platform/core/var tests/Fixtures/app/var
tests/Fixtures/app/console cache:clear --ansi
- name: Run Behat tests
run: |
mkdir -p build/logs/behat
vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat/junit --profile=default-legacy --no-interaction --colors
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v1
with:
name: behat-logs-php${{ matrix.php }}-lowest-deps-legacy
path: build/logs/behat
continue-on-error: true

phpunit-postgresql:
name: PHPUnit (PHP ${{ matrix.php }}) (PostgreSQL)
runs-on: ubuntu-latest
Expand Down
23 changes: 0 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ When you send a PR, just make sure that:
* You make the PR on the same branch you based your changes on. If you see commits
that you did not make in your PR, you're doing it wrong.
* Also don't forget to add a comment when you update a PR with a ping to [the maintainers](https://github.com/orgs/api-platform/people), so he/she will get a notification.
* Squash your commits into one commit (see the next chapter).

All Pull Requests must include [this header](.github/PULL_REQUEST_TEMPLATE.md).

Expand Down Expand Up @@ -105,28 +104,6 @@ If you want to launch Behat tests for MongoDB, the command is:

To get more details about an error, replace `--format=progress` by `-vvv`.

## Squash your Commits

If you have 3 commits, start with:

git rebase -i HEAD~3

An editor will be opened with your 3 commits, all prefixed by `pick`.

Replace all `pick` prefixes by `fixup` (or `f`) **except the first commit** of the list.

Save and quit the editor.

After that, all your commits will be squashed into the first one and the commit message will be the first one.

If you would like to rename your commit message, type:

git commit --amend

Now force push to update your PR:

git push --force-with-lease

# License and Copyright Attribution

When you open a Pull Request to the API Platform project, you agree to license your code under the [MIT license](LICENSE)
Expand Down
Loading