Skip to content

Commit 9fa5afb

Browse files
committed
Add End to End tests on GitHub CI
1 parent c5d841b commit 9fa5afb

File tree

1 file changed

+122
-0
lines changed

1 file changed

+122
-0
lines changed
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: End to End Tests
2+
3+
on:
4+
schedule:
5+
# run daily at 2:00 AM UTC
6+
- cron: '0 2 * * *'
7+
# allow manual triggering for testing purposes
8+
workflow_dispatch:
9+
10+
jobs:
11+
test-symfony-cli-installation:
12+
name: Test Symfony CLI Installation
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: '8.4'
20+
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite
21+
tools: composer
22+
coverage: none
23+
24+
- name: Install Symfony CLI
25+
run: |
26+
wget https://get.symfony.com/cli/installer -O - | bash
27+
echo "$HOME/.symfony5/bin" >> $GITHUB_PATH
28+
29+
- name: Create project using Symfony CLI
30+
run: |
31+
symfony new --demo symfony_cli_test
32+
cd symfony_cli_test
33+
34+
- name: Test application
35+
run: |
36+
cd symfony_cli_test
37+
php bin/console --version
38+
php bin/console list
39+
php bin/console cache:clear --env=test
40+
41+
test-composer-create-project:
42+
name: Test Composer Create Project
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- name: Setup PHP
47+
uses: shivammathur/setup-php@v2
48+
with:
49+
php-version: '8.4'
50+
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite
51+
coverage: none
52+
53+
- name: Create project using Composer
54+
run: |
55+
composer create-project symfony/symfony-demo composer_test
56+
cd composer_test
57+
58+
- name: Test application
59+
run: |
60+
cd composer_test
61+
php bin/console --version
62+
php bin/console list
63+
php bin/console cache:clear --env=test
64+
65+
test-git-clone-installation:
66+
name: Test Git Clone Installation
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- name: Setup PHP
71+
uses: shivammathur/setup-php@v2
72+
with:
73+
php-version: '8.4'
74+
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite
75+
coverage: none
76+
77+
- name: Clone repository and install dependencies
78+
run: |
79+
git clone https://github.com/symfony/demo.git git_clone_test
80+
cd git_clone_test
81+
composer install --no-dev --optimize-autoloader
82+
83+
- name: Test application
84+
run: |
85+
cd git_clone_test
86+
php bin/console --version
87+
php bin/console list
88+
php bin/console cache:clear --env=test
89+
90+
notify-on-failure:
91+
name: Notify on Failure
92+
runs-on: ubuntu-latest
93+
needs: [test-symfony-cli-installation, test-composer-create-project, test-git-clone-installation]
94+
if: failure()
95+
96+
steps:
97+
- name: Create Issue on Failure
98+
uses: actions/github-script@v7
99+
with:
100+
script: |
101+
const title = `End to End Test Failed - ${new Date().toISOString().split('T')[0]}`;
102+
const body = `
103+
The daily end to end test workflow has failed. This means users may be experiencing issues installing the Symfony Demo application.
104+
105+
**Failed Jobs:**
106+
- Check the workflow run for details: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
107+
108+
**Installation Methods Tested:**
109+
- Symfony CLI installation
110+
- Composer create-project
111+
- Git clone + composer install
112+
113+
Please investigate and fix the installation issues as soon as possible.
114+
`;
115+
116+
github.rest.issues.create({
117+
owner: context.repo.owner,
118+
repo: context.repo.repo,
119+
title: title,
120+
body: body,
121+
labels: ['bug']
122+
});

0 commit comments

Comments
 (0)