Skip to content

Commit 9ae133d

Browse files
committed
minor #1584 Add End to End tests on GitHub CI (javiereguiluz)
This PR was squashed before being merged into the main branch. Discussion ---------- Add End to End tests on GitHub CI To avoid issues in the future, I propose to add a daily test that checks that this application is installable and works using different methods: Symfony CLI, Composer and Git clone. Commits ------- 2706f79 Add End to End tests on GitHub CI
2 parents ea28f57 + 2706f79 commit 9ae133d

File tree

1 file changed

+119
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)