Skip to content

Commit 3ebf14c

Browse files
committed
Merge branch 'master' of github.com:propelorm/Propel2 into patch-crossref
2 parents 2781026 + 1ca6543 commit 3ebf14c

File tree

810 files changed

+43684
-22176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

810 files changed

+43684
-22176
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ phpstan-baseline.neon export-ignore linguist-generated=true
3030
.editorconfig export-ignore
3131
.gitattributes export-ignore
3232
.gitignore export-ignore
33+
.license export-ignore
34+
phpunit.xml.dist export-ignore
35+
pom.xml.dist export-ignore

.github/workflows/ci.yml

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- 'master'
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
testsuite:
12+
name: "Test Suite"
13+
runs-on: ubuntu-22.04
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php-version: [ '7.4', '8.2' ]
18+
db-type: [ sqlite, mysql, pgsql, agnostic ]
19+
symfony-version: [ '4-min', '4-max', '5-min', '5-max', '6-min', '6-max' ]
20+
exclude:
21+
- symfony-version: '4-min'
22+
php-version: '8.2'
23+
- symfony-version: '6-min'
24+
php-version: '7.4'
25+
- symfony-version: '6-max'
26+
php-version: '7.4'
27+
env:
28+
DB_NAME: 'propel_tests'
29+
DB_USER: 'propel'
30+
DB_PW: 'propel'
31+
steps:
32+
- name: Install PostgreSQL latest
33+
if: matrix.db-type == 'pgsql' && matrix.php-version != '7.4'
34+
uses: CasperWA/[email protected]
35+
with:
36+
postgresql db: $DB_NAME
37+
postgresql user: $DB_USER
38+
postgresql password: $DB_PW
39+
40+
- name: Install PostgreSQL min
41+
if: matrix.db-type == 'pgsql' && matrix.php-version == '7.4'
42+
uses: CasperWA/[email protected]
43+
with:
44+
postgresql version: 9
45+
postgresql db: $DB_NAME
46+
postgresql user: $DB_USER
47+
postgresql password: $DB_PW
48+
49+
- name: Install MySQL latest
50+
if: matrix.db-type == 'mysql' && matrix.php-version != '7.4'
51+
uses: mirromutth/[email protected]
52+
with:
53+
mysql root password: $DB_PW
54+
55+
- name: Install MariaDb min
56+
if: matrix.db-type == 'mysql' && matrix.php-version == '7.4'
57+
uses: getong/[email protected]
58+
with:
59+
mariadb version: '10.2'
60+
mysql root password: $DB_PW
61+
62+
- name: Setup PHP, with composer and extensions
63+
uses: shivammathur/setup-php@v2
64+
with:
65+
php-version: ${{ matrix.php-version }}
66+
extensions: json, libxml, pdo, pdo_mysql, pdo_sqlite, pdo_pgsql, sqlite3
67+
coverage: pcov
68+
69+
- name: Checkout
70+
uses: actions/checkout@v2
71+
72+
- name: Composer get cache directory
73+
id: composer-cache
74+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
75+
76+
- name: Composer cache dependencies
77+
uses: actions/cache@v1
78+
with:
79+
path: ${{ steps.composer-cache.outputs.dir }}
80+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
81+
restore-keys: ${{ runner.os }}-composer-
82+
83+
- name: Move specific composer.json (Symfony version ${{ matrix.symfony-version }})
84+
run: mv tests/composer/composer-symfony${{ matrix.symfony-version }}.json composer.json
85+
86+
- name: Composer install (Symfony version ${{ matrix.symfony-version }})
87+
run: composer install --no-progress --prefer-dist --optimize-autoloader
88+
89+
- name: Wait for MySQL server to load
90+
if: matrix.db-type == 'mysql'
91+
run: |
92+
bash -c "
93+
for i in {1..10}; do
94+
mysqladmin -h 127.0.0.1 -u root status >/dev/null 2>&1 && exit 0 || sleep 6
95+
echo 'trying again'
96+
done;
97+
echo 'could not establish connection after 10 tries'
98+
exit 1
99+
"
100+
env:
101+
MYSQL_PWD: ${{ env.DB_PW }}
102+
103+
- name: Create MySQL Propel user
104+
if: matrix.db-type == 'mysql'
105+
run: |
106+
mysql -h 127.0.0.1 -u root -e "
107+
CREATE USER '$DB_USER'@'localhost' IDENTIFIED BY '$DB_PW';
108+
CREATE USER '$DB_USER'@'%' IDENTIFIED BY '$DB_PW';
109+
GRANT ALL PRIVILEGES ON *.* TO '$DB_USER'@'localhost';
110+
GRANT ALL PRIVILEGES ON *.* TO '$DB_USER'@'%';
111+
FLUSH PRIVILEGES;
112+
"
113+
env:
114+
MYSQL_PWD: ${{ env.DB_PW }}
115+
116+
- name: Setup database for test suite
117+
if: matrix.db-type != 'agnostic'
118+
run: tests/bin/setup.${{ matrix.db-type }}.sh
119+
120+
- name: Run tests
121+
shell: 'script -q -e -c "bash {0}"'
122+
run: |
123+
if [[ ${{ matrix.php-version }} == '7.4' && ${{ matrix.symfony-version == '5-max' }} ]]; then
124+
export CODECOVERAGE=1 && vendor/bin/phpunit -c tests/${{ matrix.db-type }}.phpunit.xml --verbose --coverage-clover=tests/coverage.xml
125+
else
126+
vendor/bin/phpunit -c tests/${{ matrix.db-type }}.phpunit.xml
127+
fi
128+
129+
- name: Code Coverage Report
130+
if: success() && matrix.php-version == '7.4' && matrix.symfony-version == '5-max'
131+
uses: codecov/codecov-action@v1
132+
with:
133+
flags: ${{ matrix.php-version }}, ${{ matrix.db-type }}, ${{ matrix.symfony-version }}
134+
file: tests/coverage.xml
135+
136+
code-style-and-static-analysis:
137+
runs-on: ubuntu-22.04
138+
steps:
139+
- name: Setup PHP
140+
id: setup-php
141+
uses: shivammathur/setup-php@v2
142+
with:
143+
php-version: '8.1'
144+
extensions: json, libxml, pdo, pdo_mysql, pdo_sqlite, pdo_pgsql, sqlite3
145+
coverage: pcov
146+
147+
- uses: actions/checkout@v2
148+
149+
- name: Composer get cache directory
150+
id: composer-cache
151+
run: |
152+
echo "::set-output name=dir::$(composer config cache-files-dir)"
153+
154+
- name: Composer cache
155+
uses: actions/cache@v2
156+
with:
157+
path: ${{ steps.composer-cache.outputs.dir }}
158+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
159+
restore-keys: |
160+
${{ runner.os }}-composer-
161+
162+
- name: Composer validate
163+
run: composer validate
164+
165+
- name: Composer install
166+
run: composer install --prefer-dist --no-interaction
167+
168+
- name: PHPStan
169+
run: composer stan
170+
171+
- name: Psalm
172+
run: composer psalm -- --php-version=${{ steps.setup-php.outputs.php-version }}
173+
174+
- name: Code Style
175+
run: composer cs-check

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1+
.DS_Store
12
.idea/
23
vendor/
34
composer.phar
45
/composer.lock
56
autoload.php
67
phpunit.xml
8+
.phpunit.result.cache
79
pom.xml
810
php-cs-fixer.phar
911

1012
generated-classes/
13+
generated-conf/
14+
generated-sql/
1115

1216
tests/Fixtures/namespaced/build/
1317
tests/Fixtures/nestedset/build/
@@ -16,8 +20,7 @@ tests/Fixtures/schemas/build/
1620
tests/Fixtures/bookstore/build/
1721
tests/Fixtures/bookstore/propel.yaml
1822

19-
tests/Fixtures/bookstore-packaged/build/
20-
tests/Fixtures/bookstore-packaged/propel.yaml
23+
tests/Fixtures/bookstore-packaged/
2124

2225
tests/Fixtures/namespaced/propel.yaml
2326

@@ -41,3 +44,4 @@ tests/Fixtures/fixtures_built
4144
tests/graphviztest/
4245
tests/migrationdiff/
4346
tests/reversecommand/
47+
tests/test.sq3

.license

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/**
2-
* This file is part of the Propel package.
2+
* MIT License. This file is part of the Propel package.
33
* For the full copyright and license information, please view the LICENSE
44
* file that was distributed with this source code.
5-
*
6-
* @license MIT License
75
*/

0 commit comments

Comments
 (0)