From 1ece66ad18f9a1edf030aaf83e9c62e906f64fb5 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Wed, 4 Jan 2023 06:05:18 -0500 Subject: [PATCH 1/6] tmp - disable tests --- .github/workflows/ci.yaml | 160 --------------------------------- .github/workflows/phpunit.yaml | 160 +++++++++++++++++++++++++++++++++ appveyor.yml | 6 +- 3 files changed, 163 insertions(+), 163 deletions(-) delete mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/phpunit.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml deleted file mode 100644 index dea4167b3..000000000 --- a/.github/workflows/ci.yaml +++ /dev/null @@ -1,160 +0,0 @@ -name: "CI" - -on: - pull_request: - push: - branches: - - 'main' - schedule: - - cron: '0 0 * * *' - -env: - PHPUNIT_FLAGS: "-v" - SYMFONY_PHPUNIT_DIR: "$HOME/symfony-bridge/.phpunit" - -jobs: - coding-standards: - name: "Coding Standards (${{ matrix.php-version }})" - - runs-on: "ubuntu-18.04" - - strategy: - fail-fast: false - matrix: - php-version: - - '8.0' - - steps: - - - name: "Checkout code" - uses: "actions/checkout@v2" - - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "${{ matrix.php-version }}" - - - - name: "Validate composer.json" - run: "composer validate --strict --no-check-lock" - - - - name: "Composer install" - uses: "ramsey/composer-install@v1" - with: - composer-options: "--no-scripts" - - - - name: "Composer install php-cs-fixer" - uses: "ramsey/composer-install@v1" - with: - composer-options: "--no-scripts --working-dir=tools/php-cs-fixer" - - - - name: "Run friendsofphp/php-cs-fixer" - run: "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --diff" - - test: - name: "PHP ${{ matrix.php-version }} + @${{ matrix.symfony-version }} ${{ matrix.dependency-versions }} deps" - - runs-on: ubuntu-18.04 - - services: - mysql: - image: mysql:5.7 # Update server_version in phpunit.xml.dist if this changes. - env: - MYSQL_ROOT_PASSWORD: root - MYSQL_DATABASE: test_maker - ports: - - 3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - mercure: - image: dunglas/mercure - env: - SERVER_NAME: :1337 - MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' - MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' - MERCURE_EXTRA_DIRECTIVES: | - anonymous - cors_origins * - ports: - - 1337:1337 - - env: - SYMFONY_VERSION: ${{ matrix.symfony-version }} - MAKER_ALLOW_DEV_DEPS_IN_APP: ${{ matrix.allow-dev-deps-in-apps }} - - strategy: - fail-fast: false - matrix: - php-version: - - '8.1' - symfony-version: - - '5.4.*' - - '5.4.x-dev' - - '6.0.x-dev' - - '6.1.x-dev' - - '6.2.x-dev' - dependency-versions: ['highest'] - allow-dev-deps-in-apps: ['0'] - include: - # testing lowest PHP version with LTS - - php-version: '8.0.0' - symfony-version: '5.4.*' - dependency-versions: 'lowest' - # testing lowest php version with highest 5.x stable - - php-version: '8.0.0' - symfony-version: '5.4.*' - dependency-versions: 'highest' - - steps: - - name: "Checkout code" - uses: actions/checkout@v2.3.3 - - - name: "Start MySQL" - run: | - sudo /etc/init.d/mysql start - - - name: "Verify MySQL connection from host" - run: | - mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "SHOW DATABASES;" - - - name: "Setup Database" - run: | - mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test_maker;" - - - name: "Install PHP with extensions" - uses: shivammathur/setup-php@v2 - with: - coverage: "none" - php-version: ${{ matrix.php-version }} - tools: composer:v2 - - - name: "Add PHPUnit matcher" - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - - name: "Composer install" - uses: "ramsey/composer-install@v1" - with: - dependency-versions: "${{ matrix.dependency-versions }}" - - - name: "Composer install php-cs-fixer" - uses: "ramsey/composer-install@v1" - with: - composer-options: "--no-scripts --working-dir=tools/php-cs-fixer" - - - name: "Composer install twigcs" - uses: "ramsey/composer-install@v1" - with: - composer-options: "--no-scripts --working-dir=tools/twigcs" - - - name: "Install PHPUnit" - run: vendor/bin/simple-phpunit install - - - name: "PHPUnit version" - run: vendor/bin/simple-phpunit --version - - - name: "Run tests" - run: vendor/bin/simple-phpunit ${{ env.PHPUNIT_FLAGS }} diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml new file mode 100644 index 000000000..3d1c18d21 --- /dev/null +++ b/.github/workflows/phpunit.yaml @@ -0,0 +1,160 @@ +name: "CI" + +on: + pull_request: + push: + branches: + - 'main' + schedule: + - cron: '0 0 * * *' + +env: + PHPUNIT_FLAGS: "-v" + SYMFONY_PHPUNIT_DIR: "$HOME/symfony-bridge/.phpunit" + +jobs: + coding-standards: + name: "Coding Standards (${{ matrix.php-version }})" + + runs-on: "ubuntu-18.04" + + strategy: + fail-fast: false + matrix: + php-version: + - '8.0' + + steps: + - + name: "Checkout code" + uses: "actions/checkout@v2" + + - + name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "${{ matrix.php-version }}" + + - + name: "Validate composer.json" + run: "composer validate --strict --no-check-lock" + + - + name: "Composer install" + uses: "ramsey/composer-install@v1" + with: + composer-options: "--no-scripts" + + - + name: "Composer install php-cs-fixer" + uses: "ramsey/composer-install@v1" + with: + composer-options: "--no-scripts --working-dir=tools/php-cs-fixer" + + - + name: "Run friendsofphp/php-cs-fixer" + run: "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --diff" + +# test: +# name: "PHP ${{ matrix.php-version }} + @${{ matrix.symfony-version }} ${{ matrix.dependency-versions }} deps" +# +# runs-on: ubuntu-18.04 +# +# services: +# mysql: +# image: mysql:5.7 # Update server_version in phpunit.xml.dist if this changes. +# env: +# MYSQL_ROOT_PASSWORD: root +# MYSQL_DATABASE: test_maker +# ports: +# - 3306 +# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 +# mercure: +# image: dunglas/mercure +# env: +# SERVER_NAME: :1337 +# MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' +# MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' +# MERCURE_EXTRA_DIRECTIVES: | +# anonymous +# cors_origins * +# ports: +# - 1337:1337 +# +# env: +# SYMFONY_VERSION: ${{ matrix.symfony-version }} +# MAKER_ALLOW_DEV_DEPS_IN_APP: ${{ matrix.allow-dev-deps-in-apps }} +# +# strategy: +# fail-fast: false +# matrix: +# php-version: +# - '8.1' +# symfony-version: +# - '5.4.*' +# - '5.4.x-dev' +# - '6.0.x-dev' +# - '6.1.x-dev' +# - '6.2.x-dev' +# dependency-versions: ['highest'] +# allow-dev-deps-in-apps: ['0'] +# include: +# # testing lowest PHP version with LTS +# - php-version: '8.0.0' +# symfony-version: '5.4.*' +# dependency-versions: 'lowest' +# # testing lowest php version with highest 5.x stable +# - php-version: '8.0.0' +# symfony-version: '5.4.*' +# dependency-versions: 'highest' +# +# steps: +# - name: "Checkout code" +# uses: actions/checkout@v2.3.3 +# +# - name: "Start MySQL" +# run: | +# sudo /etc/init.d/mysql start +# +# - name: "Verify MySQL connection from host" +# run: | +# mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "SHOW DATABASES;" +# +# - name: "Setup Database" +# run: | +# mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test_maker;" +# +# - name: "Install PHP with extensions" +# uses: shivammathur/setup-php@v2 +# with: +# coverage: "none" +# php-version: ${{ matrix.php-version }} +# tools: composer:v2 +# +# - name: "Add PHPUnit matcher" +# run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" +# +# - name: "Composer install" +# uses: "ramsey/composer-install@v1" +# with: +# dependency-versions: "${{ matrix.dependency-versions }}" +# +# - name: "Composer install php-cs-fixer" +# uses: "ramsey/composer-install@v1" +# with: +# composer-options: "--no-scripts --working-dir=tools/php-cs-fixer" +# +# - name: "Composer install twigcs" +# uses: "ramsey/composer-install@v1" +# with: +# composer-options: "--no-scripts --working-dir=tools/twigcs" +# +# - name: "Install PHPUnit" +# run: vendor/bin/simple-phpunit install +# +# - name: "PHPUnit version" +# run: vendor/bin/simple-phpunit --version +# +# - name: "Run tests" +# run: vendor/bin/simple-phpunit ${{ env.PHPUNIT_FLAGS }} diff --git a/appveyor.yml b/appveyor.yml index b5a37b99e..6801857e6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -60,6 +60,6 @@ install: - composer install --no-interaction --no-progress --ansi --no-scripts --working-dir=tools/php-cs-fixer - vendor/bin/simple-phpunit install -test_script: - - cd C:\projects\maker-bundle - - vendor/bin/simple-phpunit +#test_script: +# - cd C:\projects\maker-bundle +# - vendor/bin/simple-phpunit From cb25b1726ae5e9b4303c863c6878197c98f4d907 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Wed, 4 Jan 2023 06:05:38 -0500 Subject: [PATCH 2/6] split static vs unit tests --- .github/workflows/phpunit.yaml | 4 ---- .github/workflows/static.yaml | 37 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/static.yaml diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index 3d1c18d21..a5a546400 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -36,10 +36,6 @@ jobs: coverage: "none" php-version: "${{ matrix.php-version }}" - - - name: "Validate composer.json" - run: "composer validate --strict --no-check-lock" - - name: "Composer install" uses: "ramsey/composer-install@v1" diff --git a/.github/workflows/static.yaml b/.github/workflows/static.yaml new file mode 100644 index 000000000..ddf9b7960 --- /dev/null +++ b/.github/workflows/static.yaml @@ -0,0 +1,37 @@ +name: Static + +on: + push: + branches: + - main + pull_request: + release: + +jobs: + composer-validate: + name: Validate composer.json + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Validate + run: composer validate --strict --no-check-lock + + php-cs-fixer: + name: PHP-CS-Fixer + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + tools: php-cs-fixer + + - name: Style Check + run: php-cs-fixer fix --dry-run --diff From ee01981f5b14678c4ab6f2173c086aa3aca3378f Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Wed, 4 Jan 2023 06:07:42 -0500 Subject: [PATCH 3/6] 8.1 for php-cs-fixer --- .github/workflows/static.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/static.yaml b/.github/workflows/static.yaml index ddf9b7960..0de790d02 100644 --- a/.github/workflows/static.yaml +++ b/.github/workflows/static.yaml @@ -30,7 +30,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.1' tools: php-cs-fixer - name: Style Check From 8dce08d18922a2cfa49b22911f3a993972b40ef7 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Wed, 4 Jan 2023 06:17:35 -0500 Subject: [PATCH 4/6] run tests --- .github/workflows/phpunit.yaml | 228 ++++++++++++++------------------- .github/workflows/static.yaml | 2 + 2 files changed, 97 insertions(+), 133 deletions(-) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index a5a546400..01165bf80 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -13,144 +13,106 @@ env: SYMFONY_PHPUNIT_DIR: "$HOME/symfony-bridge/.phpunit" jobs: - coding-standards: - name: "Coding Standards (${{ matrix.php-version }})" + test: + name: "PHP ${{ matrix.php-version }} + @${{ matrix.symfony-version }} ${{ matrix.dependency-versions }} deps" - runs-on: "ubuntu-18.04" + runs-on: ubuntu-latest + + services: + mysql: + image: mysql:5.7 # Update server_version in phpunit.xml.dist if this changes. + env: + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: test_maker + ports: + - 3306 + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + mercure: + image: dunglas/mercure + env: + SERVER_NAME: :1337 + MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' + MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' + MERCURE_EXTRA_DIRECTIVES: | + anonymous + cors_origins * + ports: + - 1337:1337 + + env: + SYMFONY_VERSION: ${{ matrix.symfony-version }} + MAKER_ALLOW_DEV_DEPS_IN_APP: ${{ matrix.allow-dev-deps-in-apps }} strategy: fail-fast: false matrix: php-version: - - '8.0' + - '8.1' + - '8.2' + symfony-version: + - '5.4.*' + - '5.4.x-dev' + - '6.0.x-dev' + - '6.1.x-dev' + - '6.2.x-dev' + dependency-versions: ['highest'] + allow-dev-deps-in-apps: ['0'] + include: + # testing lowest PHP version with LTS + - php-version: '8.0.0' + symfony-version: '5.4.*' + dependency-versions: 'lowest' + # testing lowest php version with highest 5.x stable + - php-version: '8.0.0' + symfony-version: '5.4.*' + dependency-versions: 'highest' steps: - - - name: "Checkout code" - uses: "actions/checkout@v2" - - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "${{ matrix.php-version }}" - - - - name: "Composer install" - uses: "ramsey/composer-install@v1" - with: - composer-options: "--no-scripts" - - - - name: "Composer install php-cs-fixer" - uses: "ramsey/composer-install@v1" - with: - composer-options: "--no-scripts --working-dir=tools/php-cs-fixer" - - - - name: "Run friendsofphp/php-cs-fixer" - run: "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --dry-run --diff" - -# test: -# name: "PHP ${{ matrix.php-version }} + @${{ matrix.symfony-version }} ${{ matrix.dependency-versions }} deps" -# -# runs-on: ubuntu-18.04 -# -# services: -# mysql: -# image: mysql:5.7 # Update server_version in phpunit.xml.dist if this changes. -# env: -# MYSQL_ROOT_PASSWORD: root -# MYSQL_DATABASE: test_maker -# ports: -# - 3306 -# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 -# mercure: -# image: dunglas/mercure -# env: -# SERVER_NAME: :1337 -# MERCURE_PUBLISHER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' -# MERCURE_SUBSCRIBER_JWT_KEY: '!ChangeThisMercureHubJWTSecretKey!' -# MERCURE_EXTRA_DIRECTIVES: | -# anonymous -# cors_origins * -# ports: -# - 1337:1337 -# -# env: -# SYMFONY_VERSION: ${{ matrix.symfony-version }} -# MAKER_ALLOW_DEV_DEPS_IN_APP: ${{ matrix.allow-dev-deps-in-apps }} -# -# strategy: -# fail-fast: false -# matrix: -# php-version: -# - '8.1' -# symfony-version: -# - '5.4.*' -# - '5.4.x-dev' -# - '6.0.x-dev' -# - '6.1.x-dev' -# - '6.2.x-dev' -# dependency-versions: ['highest'] -# allow-dev-deps-in-apps: ['0'] -# include: -# # testing lowest PHP version with LTS -# - php-version: '8.0.0' -# symfony-version: '5.4.*' -# dependency-versions: 'lowest' -# # testing lowest php version with highest 5.x stable -# - php-version: '8.0.0' -# symfony-version: '5.4.*' -# dependency-versions: 'highest' -# -# steps: -# - name: "Checkout code" -# uses: actions/checkout@v2.3.3 -# -# - name: "Start MySQL" -# run: | -# sudo /etc/init.d/mysql start -# -# - name: "Verify MySQL connection from host" -# run: | -# mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "SHOW DATABASES;" -# -# - name: "Setup Database" -# run: | -# mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test_maker;" -# -# - name: "Install PHP with extensions" -# uses: shivammathur/setup-php@v2 -# with: -# coverage: "none" -# php-version: ${{ matrix.php-version }} -# tools: composer:v2 -# -# - name: "Add PHPUnit matcher" -# run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" -# -# - name: "Composer install" -# uses: "ramsey/composer-install@v1" -# with: -# dependency-versions: "${{ matrix.dependency-versions }}" -# -# - name: "Composer install php-cs-fixer" -# uses: "ramsey/composer-install@v1" -# with: -# composer-options: "--no-scripts --working-dir=tools/php-cs-fixer" -# -# - name: "Composer install twigcs" -# uses: "ramsey/composer-install@v1" -# with: -# composer-options: "--no-scripts --working-dir=tools/twigcs" -# -# - name: "Install PHPUnit" -# run: vendor/bin/simple-phpunit install -# -# - name: "PHPUnit version" -# run: vendor/bin/simple-phpunit --version -# -# - name: "Run tests" -# run: vendor/bin/simple-phpunit ${{ env.PHPUNIT_FLAGS }} + - name: "Checkout code" + uses: actions/checkout@v2.3.3 + + - name: "Start MySQL" + run: | + sudo /etc/init.d/mysql start + + - name: "Verify MySQL connection from host" + run: | + mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "SHOW DATABASES;" + + - name: "Setup Database" + run: | + mysql --host 127.0.0.1 --port 3306 -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test_maker;" + + - name: "Install PHP with extensions" + uses: shivammathur/setup-php@v2 + with: + coverage: "none" + php-version: ${{ matrix.php-version }} + tools: composer:v2 + + - name: "Add PHPUnit matcher" + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: "Composer install" + uses: "ramsey/composer-install@v1" + with: + dependency-versions: "${{ matrix.dependency-versions }}" + + - name: "Composer install php-cs-fixer" + uses: "ramsey/composer-install@v1" + with: + composer-options: "--no-scripts --working-dir=tools/php-cs-fixer" + + - name: "Composer install twigcs" + uses: "ramsey/composer-install@v1" + with: + composer-options: "--no-scripts --working-dir=tools/twigcs" + + - name: "Install PHPUnit" + run: vendor/bin/simple-phpunit install + + - name: "PHPUnit version" + run: vendor/bin/simple-phpunit --version + + - name: "Run tests" + run: vendor/bin/simple-phpunit ${{ env.PHPUNIT_FLAGS }} diff --git a/.github/workflows/static.yaml b/.github/workflows/static.yaml index 0de790d02..60d0e1949 100644 --- a/.github/workflows/static.yaml +++ b/.github/workflows/static.yaml @@ -6,6 +6,8 @@ on: - main pull_request: release: + schedule: + - cron: '0 0 * * *' jobs: composer-validate: From dd0cacd681c6ee0cbd8e14e90a9b373e2322b9b8 Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Wed, 4 Jan 2023 06:19:28 -0500 Subject: [PATCH 5/6] better name --- .github/workflows/phpunit.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index 01165bf80..41269c41b 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -1,4 +1,4 @@ -name: "CI" +name: PHPUnit on: pull_request: @@ -14,7 +14,7 @@ env: jobs: test: - name: "PHP ${{ matrix.php-version }} + @${{ matrix.symfony-version }} ${{ matrix.dependency-versions }} deps" + name: "${{ matrix.php-version }} + @${{ matrix.symfony-version }} ${{ matrix.dependency-versions }} deps" runs-on: ubuntu-latest From 3028909fef47a9c18b974e35bb4ba11e77989fdf Mon Sep 17 00:00:00 2001 From: Jesse Rushlow Date: Wed, 4 Jan 2023 06:21:59 -0500 Subject: [PATCH 6/6] test symfony 6.3 --- .github/workflows/phpunit.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/phpunit.yaml b/.github/workflows/phpunit.yaml index 41269c41b..3d199dea6 100644 --- a/.github/workflows/phpunit.yaml +++ b/.github/workflows/phpunit.yaml @@ -55,6 +55,7 @@ jobs: - '6.0.x-dev' - '6.1.x-dev' - '6.2.x-dev' + - '6.3.x-dev' dependency-versions: ['highest'] allow-dev-deps-in-apps: ['0'] include: