From f9032087bab1c38fa1d715aea54bd3e55678b6a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Wed, 22 Apr 2020 07:57:06 +0200 Subject: [PATCH 01/11] Fix: Install ext-intl --- .github/workflows/continuous-integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 1bda77ec8..bd992949e 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -40,6 +40,7 @@ jobs: uses: "shivammathur/setup-php@v2" with: coverage: "none" + extensions: "intl" ini-values: "memory_limit=-1" php-version: "${{ matrix.php-version }}" From ef8c410098f9d29c25d46c00ee41140a0ee5fa8c Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 21 Apr 2020 16:42:22 +0200 Subject: [PATCH 02/11] GithubActions: build master branch + pull requests --- .github/workflows/continuous-integration.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index bd992949e..dede30fdd 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -3,6 +3,7 @@ name: "Continuous Integration" on: + - "push" - "pull_request" env: From acef74d1abffeb20a934709c7fde964aae742444 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 22 Apr 2020 08:28:14 +0200 Subject: [PATCH 03/11] Attempt at optimizing the job matrix --- .github/workflows/continuous-integration.yml | 33 +++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index dede30fdd..14c39e8d3 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -7,17 +7,19 @@ on: - "pull_request" env: - COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist --optimize-autoloader" + COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist" SYMFONY_PHPUNIT_VERSION: "" jobs: tests: name: "Tests" - runs-on: "ubuntu-latest" + runs-on: ${{ matrix.os }} strategy: matrix: + os: [ubuntu-latest] + dependencies: [locked] php-version: - "5.3" - "5.4" @@ -28,10 +30,22 @@ jobs: - "7.2" - "7.3" - "7.4" - - dependencies: - - "locked" - - "highest" + include: + - php-version: 5.3 + os: ubuntu-latest + dependencies: highest + - php-version: 5.3 + os: ubuntu-latest + dependencies: lowest + - php-version: 7.4 + os: ubuntu-latest + dependencies: highest + - php-version: 7.4 + os: windows-latest + dependencies: locked + - php-version: 7.4 + os: macos-latest + dependencies: locked steps: - name: "Checkout" @@ -60,12 +74,15 @@ jobs: if: "matrix.dependencies == 'highest'" run: "composer update ${{ env.COMPOSER_FLAGS }}" + - name: "Install lowest dependencies from composer.lock using composer binary provided by system" + if: "matrix.dependencies == 'lowest'" + run: "composer install ${{ env.COMPOSER_FLAGS }} --prefer-lowest" + - name: "Install dependencies from composer.lock using composer binary provided by system" if: "matrix.dependencies == 'locked'" run: "composer install ${{ env.COMPOSER_FLAGS }}" - - name: "Install dependencies from composer.lock using composer binary from source" - if: "matrix.dependencies == 'locked'" + - name: "Run install again using composer binary from source" run: "bin/composer install ${{ env.COMPOSER_FLAGS }}" - name: "Prepare git environment" From ebd30cf8310c010eca7a980fa0811d209fdfc3e3 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 22 Apr 2020 08:30:44 +0200 Subject: [PATCH 04/11] Use correct command.. --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 14c39e8d3..3a794c5a5 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -76,7 +76,7 @@ jobs: - name: "Install lowest dependencies from composer.lock using composer binary provided by system" if: "matrix.dependencies == 'lowest'" - run: "composer install ${{ env.COMPOSER_FLAGS }} --prefer-lowest" + run: "composer update ${{ env.COMPOSER_FLAGS }} --prefer-lowest" - name: "Install dependencies from composer.lock using composer binary provided by system" if: "matrix.dependencies == 'locked'" From a849e2b24426e9434c63cac20890d3d842d28a57 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 22 Apr 2020 09:27:58 +0200 Subject: [PATCH 05/11] Add linting, php8, release builds to github actions --- .github/workflows/continuous-integration.yml | 36 ++++++++----- .github/workflows/lint.yml | 38 +++++++++++++ .github/workflows/release.yml | 57 ++++++++++++++++++++ 3 files changed, 119 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 3a794c5a5..d4dc5f01a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -1,10 +1,14 @@ -# https://help.github.com/en/categories/automating-your-workflow-with-github-actions - name: "Continuous Integration" on: - - "push" - - "pull_request" + push: + paths-ignore: + - '.github/**' + - 'doc/**' + pull_request: + paths-ignore: + - '.github/**' + - 'doc/**' env: COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist" @@ -12,14 +16,13 @@ env: jobs: tests: - name: "Tests" + name: "CI" runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.experimental }} strategy: matrix: - os: [ubuntu-latest] - dependencies: [locked] php-version: - "5.3" - "5.4" @@ -30,22 +33,28 @@ jobs: - "7.2" - "7.3" - "7.4" + dependencies: [locked] + os: [ubuntu-latest] include: - php-version: 5.3 - os: ubuntu-latest dependencies: highest + os: ubuntu-latest - php-version: 5.3 - os: ubuntu-latest dependencies: lowest - - php-version: 7.4 os: ubuntu-latest + - php-version: 7.4 dependencies: highest + os: ubuntu-latest - php-version: 7.4 os: windows-latest dependencies: locked - php-version: 7.4 os: macos-latest dependencies: locked + - php-version: 8.0 + dependencies: highest + os: ubuntu-latest + experimental: true steps: - name: "Checkout" @@ -72,9 +81,9 @@ jobs: - name: "Install highest dependencies from composer.json using composer binary provided by system" if: "matrix.dependencies == 'highest'" - run: "composer update ${{ env.COMPOSER_FLAGS }}" + run: "composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }}" - - name: "Install lowest dependencies from composer.lock using composer binary provided by system" + - name: "Install lowest dependencies from composer.json using composer binary provided by system" if: "matrix.dependencies == 'lowest'" run: "composer update ${{ env.COMPOSER_FLAGS }} --prefer-lowest" @@ -85,6 +94,9 @@ jobs: - name: "Run install again using composer binary from source" run: "bin/composer install ${{ env.COMPOSER_FLAGS }}" + - name: "Validate composer.json" + run: "bin/composer validate" + - name: "Prepare git environment" run: "git config --global user.name composer && git config --global user.email composer@example.com" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..ba699953e --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,38 @@ +name: "PHP Lint" + +on: + push: + paths-ignore: + - '.github/**' + - 'doc/**' + pull_request: + paths-ignore: + - '.github/**' + - 'doc/**' + +jobs: + tests: + name: "Lint" + + runs-on: ubuntu-latest + + strategy: + matrix: + php-version: + - "5.3" + - "7.4" + + steps: + - name: "Checkout" + uses: "actions/checkout@v2" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + extensions: "intl" + ini-values: "memory_limit=-1" + php-version: "${{ matrix.php-version }}" + + - name: "Lint PHP files" + run: "find src/ -type f -name '*.php' -print0 | xargs -0 -L1 -P4 -- php -l -f" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..3e5f37fef --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,57 @@ +name: "Release" + +on: + push: + - tags + +env: + COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist" + +jobs: + build: + name: Upload Release Asset + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + extensions: "intl" + ini-values: "memory_limit=-1" + php-version: "7.4" + + - name: "Install dependencies from composer.lock using composer binary provided by system" + run: "composer install ${{ env.COMPOSER_FLAGS }}" + + - name: "Run install again using composer binary from source" + run: "bin/composer install ${{ env.COMPOSER_FLAGS }}" + + - name: "Validate composer.json" + run: "bin/composer validate" + + - name: Build phar file + run: "php -d phar.readonly=0 bin/compile" + + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: true + body: TODO + + - name: Upload phar + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./composer.phar + asset_name: composer.phar + asset_content_type: application/octet-stream From ac3fcfc9ec0caf9d8f244aa61e509f814ee14935 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 22 Apr 2020 09:30:34 +0200 Subject: [PATCH 06/11] Fix build --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3e5f37fef..8c4ca1d40 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,8 @@ name: "Release" on: push: - - tags + tags: + - * env: COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist" From 9a0e6e68853c80378c0f21cf8dee2c3cc72efd7f Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 22 Apr 2020 09:31:04 +0200 Subject: [PATCH 07/11] Fix build --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8c4ca1d40..a67b4e6e5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: "Release" on: push: tags: - - * + - "*" env: COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist" From eeaa099021ba04c935a4ab80dc898c621e3b7136 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 22 Apr 2020 09:32:50 +0200 Subject: [PATCH 08/11] Stop ignoring build changes to trigger build, that was smart :D --- .github/workflows/continuous-integration.yml | 2 -- .github/workflows/lint.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index d4dc5f01a..7fe67829a 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -3,11 +3,9 @@ name: "Continuous Integration" on: push: paths-ignore: - - '.github/**' - 'doc/**' pull_request: paths-ignore: - - '.github/**' - 'doc/**' env: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ba699953e..0db4f34cb 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -3,11 +3,9 @@ name: "PHP Lint" on: push: paths-ignore: - - '.github/**' - 'doc/**' pull_request: paths-ignore: - - '.github/**' - 'doc/**' jobs: From f51810f1c9f3694e9d615323222bb52f09e0c7c4 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 22 Apr 2020 09:33:55 +0200 Subject: [PATCH 09/11] Fix continue-on-error failure --- .github/workflows/continuous-integration.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 7fe67829a..97e2b6558 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -33,22 +33,28 @@ jobs: - "7.4" dependencies: [locked] os: [ubuntu-latest] + experimental: [false] include: - php-version: 5.3 dependencies: highest os: ubuntu-latest + experimental: false - php-version: 5.3 dependencies: lowest os: ubuntu-latest + experimental: false - php-version: 7.4 dependencies: highest os: ubuntu-latest + experimental: false - php-version: 7.4 os: windows-latest dependencies: locked + experimental: false - php-version: 7.4 os: macos-latest dependencies: locked + experimental: false - php-version: 8.0 dependencies: highest os: ubuntu-latest From 4ccd8e10810bd63c8b2d01c1a1a7c5f26e04d1f5 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 22 Apr 2020 09:37:04 +0200 Subject: [PATCH 10/11] Mark 7.4 latest deps build experimental for now --- .github/workflows/continuous-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 97e2b6558..89eafea47 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -46,7 +46,7 @@ jobs: - php-version: 7.4 dependencies: highest os: ubuntu-latest - experimental: false + experimental: true # TODO fix build errors there if possible - php-version: 7.4 os: windows-latest dependencies: locked From ca25ff8b0d7e8931161dfccae9b0237be0b54f95 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Wed, 22 Apr 2020 09:40:35 +0200 Subject: [PATCH 11/11] Remove travis/appveyor configs --- .travis.yml | 76 ---------------------------------------------------- appveyor.yml | 33 ----------------------- 2 files changed, 109 deletions(-) delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 64ee75f3a..000000000 --- a/.travis.yml +++ /dev/null @@ -1,76 +0,0 @@ -language: php - -dist: trusty - -git: - depth: 5 - -cache: - directories: - - $HOME/.composer/cache - -addons: - apt: - packages: - - parallel - -matrix: - include: - - php: 5.3 - dist: precise - - php: 5.4 - - php: 5.5 - - php: 5.6 - - php: 7.0 - - php: 7.1 - - php: 7.2 - - php: 7.3 - - php: nightly - - php: 7.4 - env: - - deps=high - - SYMFONY_PHPUNIT_VERSION=7.5 - fast_finish: true - allow_failures: - - php: nightly - -before_install: - # disable Xdebug if available - - phpenv config-rm xdebug.ini || echo "xdebug not available" - # disable default memory limit - - export INI=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - - echo memory_limit = -1 >> $INI - - composer validate - -install: - # flags to pass to install - - flags="--ansi --prefer-dist --no-interaction --optimize-autoloader --no-suggest --no-progress" - # update deps to latest in case of high deps build - - if [ "$deps" == "high" ]; then composer config platform.php 7.2.4; composer update $flags; fi - # install dependencies using system provided composer binary - - composer install $flags - # install dependencies using composer from source - - bin/composer install $flags - -before_script: - # make sure git tests do not complain about user/email not being set - - git config --global user.name travis-ci - - git config --global user.email travis@example.com - -script: - - ./vendor/bin/simple-phpunit - # run test suite directories in parallel using GNU parallel -# - ls -d tests/Composer/Test/* | grep -v TestCase.php | parallel --gnu --keep-order 'echo "Running {} tests"; ./vendor/bin/phpunit -c tests/complete.phpunit.xml --colors=always {} || (echo -e "\e[41mFAILED\e[0m {}" && exit 1);' - -before_deploy: - - php -d phar.readonly=0 bin/compile - -deploy: - provider: releases - api_key: $GITHUB_TOKEN - file: composer.phar - skip_cleanup: true - on: - tags: true - repo: composer/composer - php: '7.2' diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 922a20e75..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,33 +0,0 @@ -build: false -clone_depth: 5 - -environment: - # This sets the PHP version (from Chocolatey) - PHPCI_CHOCO_VERSION: 7.3.1 - PHPCI_CACHE: C:\tools\phpci - PHPCI_PHP: C:\tools\phpci\php - PHPCI_COMPOSER: C:\tools\phpci\composer - -cache: - - '%PHPCI_CACHE% -> appveyor.yml' - -init: - - SET PATH=%PHPCI_PHP%;%PHPCI_COMPOSER%;%PATH% - - SET COMPOSER_HOME=%PHPCI_COMPOSER%\home - - SET COMPOSER_CACHE_DIR=%PHPCI_COMPOSER%\cache - - SET COMPOSER_NO_INTERACTION=1 - - SET PHP=0 - - SET ANSICON=121x90 (121x90) - -install: - - IF EXIST %PHPCI_CACHE% (SET PHP=1) - - IF %PHP%==0 cinst php -i -y --version %PHPCI_CHOCO_VERSION% --params "/InstallDir:%PHPCI_PHP%" - - IF %PHP%==0 cinst composer -i -y --ia "/DEV=%PHPCI_COMPOSER%" - - php -v - - IF %PHP%==0 (composer --version) ELSE (composer self-update) - - cd %APPVEYOR_BUILD_FOLDER% - - composer install --prefer-dist --no-progress - -test_script: - - cd %APPVEYOR_BUILD_FOLDER% - - vendor\bin\simple-phpunit --colors=always