End to End Tests #27
This file contains hidden or 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
name: End to End Tests | |
on: | |
schedule: | |
# run daily at 2:00 AM UTC | |
- cron: '0 2 * * *' | |
# allow manual triggering for testing purposes | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
test-symfony-cli-installation: | |
name: Test Symfony CLI Installation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
coverage: none | |
extensions: none, ctype, dom, iconv, intl, mbstring, pdo_sqlite, simplexml, tokenizer, xml, xmlwriter | |
php-version: '8.2' | |
tools: symfony-cli | |
- name: Configure environment | |
run: | | |
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: ${{ github.job }} | |
run: | | |
php bin/console about | |
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 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
coverage: none | |
extensions: none, ctype, dom, iconv, intl, mbstring, pdo_sqlite, simplexml, tokenizer, xml, xmlwriter | |
php-version: latest | |
tools: symfony-cli | |
- name: Create project using Composer | |
run: composer create-project symfony/symfony-demo ${{ github.job }} | |
- name: Test application | |
working-directory: ${{ github.job }} | |
run: | | |
php bin/console about | |
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 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
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 ${{ github.job }} | |
cd ${{ github.job }} | |
composer install | |
- name: Test application | |
working-directory: ${{ github.job }} | |
run: | | |
php bin/console about | |
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 | |
needs: [test-symfony-cli-installation, test-composer-create-project, test-git-clone-installation] | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
steps: | |
- name: Create Issue on Failure | |
uses: actions/github-script@v7 | |
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. | |
**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 | |
Please investigate and fix the installation issues as soon as possible. | |
`; | |
github.rest.issues.create({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
title: title, | |
body: body, | |
labels: ['bug'] | |
}); |