Skip to content

[CI] Fixes and tweaks for the demo install test #1590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
90 changes: 52 additions & 38 deletions .github/workflows/end_to_end_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ on:
schedule:
# run daily at 2:00 AM UTC
- cron: '0 2 * * *'
# allow manual triggering for testing purposes
workflow_dispatch:

# allow manual triggering for testing purposes
workflow_dispatch:

permissions:
contents: read

jobs:
test-symfony-cli-installation:
Expand All @@ -16,21 +20,27 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: none, ctype, iconv, intl, mbstring, pdo_sqlite, xml
coverage: none
tools: symfony
extensions: none, ctype, dom, iconv, intl, mbstring, pdo_sqlite, simplexml, tokenizer, xml, xmlwriter
php-version: '8.2'
tools: symfony-cli

- name: Create project using Symfony CLI
- name: Configure environment
run: |
symfony new --demo symfony_cli_test
git config --global init.defaultBranch main
git config --global user.email "[email protected]"
git config --global user.name "Symfony Demo"

- name: Create project using Symfony CLI
run: symfony new --demo ${{ github.job }}

- name: Test application
working-directory: ./symfony_cli_test
working-directory: ${{ github.job }}
run: |
php bin/console about
php bin/console list
php bin/console cache:clear --env=test
symfony server:start -d --no-tls
curl --fail --max-time 5 --no-progress-meter --output home.html -v http://127.0.0.1:8000/
symfony server:stop

test-composer-create-project:
name: Test Composer Create Project
Expand All @@ -40,21 +50,22 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: none, ctype, iconv, intl, mbstring, pdo_sqlite, xml
tools: composer
coverage: none
extensions: none, ctype, dom, iconv, intl, mbstring, pdo_sqlite, simplexml, tokenizer, xml, xmlwriter
php-version: latest
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the above test with symfony new also does use composer create-project internally I opted for a different PHP version for this job

tools: symfony-cli

- name: Create project using Composer
run: |
composer create-project symfony/symfony-demo composer_test
run: composer create-project symfony/symfony-demo ${{ github.job }}

- name: Test application
working-directory: ./composer_test
working-directory: ${{ github.job }}
run: |
rm -v .env.local
php bin/console about
php bin/console list
php bin/console cache:clear --env=test
symfony server:start -d --no-tls
curl --fail --max-time 5 --no-progress-meter --output home.html -v http://127.0.0.1:8000/
symfony server:stop

test-git-clone-installation:
name: Test Git Clone Installation
Expand All @@ -64,29 +75,31 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: none, ctype, iconv, intl, mbstring, pdo_sqlite, xml
tools: composer
coverage: none
extensions: none, ctype, dom, iconv, intl, mbstring, pdo_sqlite, simplexml, tokenizer, xml, xmlwriter
php-version: '8.3'
tools: symfony-cli

- name: Clone repository and install dependencies
run: |
git clone https://github.com/symfony/demo.git git_clone_test
cd git_clone_test
composer install --no-dev --optimize-autoloader
git clone https://github.com/symfony/demo.git ${{ github.job }}
cd ${{ github.job }}
composer install

- name: Test application
working-directory: ./git_clone_test
working-directory: ${{ github.job }}
run: |
php bin/console about
php bin/console list
php bin/console cache:clear --env=test
symfony server:start -d --no-tls
curl --fail --max-time 5 --no-progress-meter --output home.html -v http://127.0.0.1:8000/
symfony server:stop

notify-on-failure:
if: failure()
name: Notify on Failure
runs-on: ubuntu-latest
needs: [test-symfony-cli-installation, test-composer-create-project, test-git-clone-installation]
if: failure()
runs-on: ubuntu-latest

permissions:
issues: write

Expand All @@ -96,18 +109,19 @@ jobs:
with:
script: |
const title = `End to End Test Failed - ${new Date().toISOString().split('T')[0]}`;
const body = `
The daily end to end test workflow has failed. This means users may be experiencing issues installing the Symfony Demo application.
const body = `The daily end to end test workflow has failed.

This means users may be experiencing issues installing the Symfony Demo application.

**Failed Jobs:**
- Check the workflow run for details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
**Failed Jobs:**
- Check the workflow run for details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

**Installation Methods Tested:**
- Symfony CLI installation
- Composer create-project
- Git clone + composer install
**Installation Methods Tested:**
- Symfony CLI installation
- Composer create-project
- Git clone + composer install

Please investigate and fix the installation issues as soon as possible.
Please investigate and fix the installation issues as soon as possible.
`;

github.rest.issues.create({
Expand Down
Loading