Skip to content

Commit 8473303

Browse files
authored
Merge pull request #380 from dotkernel/issue-292
GHA for database validation
2 parents ae621c2 + d384e13 commit 8473303

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
on:
2+
- push
3+
4+
name: Validate database schema
5+
6+
jobs:
7+
validate-database-schema:
8+
name: Validate database schema
9+
10+
permissions:
11+
contents: read
12+
pull-requests: write
13+
14+
runs-on: ${{ matrix.os }}
15+
16+
env:
17+
TEST_MODE: "true"
18+
19+
strategy:
20+
matrix:
21+
os:
22+
- ubuntu-latest
23+
24+
php:
25+
- "8.2"
26+
- "8.3"
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Install PHP
33+
uses: shivammathur/setup-php@v2
34+
with:
35+
php-version: "${{ matrix.php }}"
36+
extensions: pdo, pdo_sqlite
37+
38+
- name: Determine composer cache directory
39+
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV
40+
41+
- name: Cache dependencies installed with composer
42+
uses: actions/cache@v4
43+
with:
44+
path: ${{ env.COMPOSER_CACHE_DIR }}
45+
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
46+
restore-keys: |
47+
php${{ matrix.php }}-composer-
48+
49+
- name: Install dependencies with composer
50+
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
51+
52+
- name: Validate database schema
53+
run: php bin/doctrine orm:validate-schema --skip-sync

0 commit comments

Comments
 (0)