|
5 | 5 | branches: [ master ]
|
6 | 6 | tags:
|
7 | 7 | - 'v*.*.*'
|
| 8 | + |
8 | 9 | pull_request:
|
9 | 10 | branches: [ master ]
|
| 11 | + |
10 | 12 | workflow_dispatch:
|
11 | 13 |
|
12 | 14 | jobs:
|
|
42 | 44 |
|
43 | 45 | - name: Run PHPUnit tests
|
44 | 46 | run: composer test
|
| 47 | + |
| 48 | + test_installation: |
| 49 | + name: Test Project Installation |
| 50 | + runs-on: ubuntu-latest |
| 51 | + |
| 52 | + steps: |
| 53 | + - name: Checkout code |
| 54 | + uses: actions/checkout@v4 |
| 55 | + |
| 56 | + - name: Setup PHP |
| 57 | + uses: shivammathur/setup-php@v2 |
| 58 | + with: |
| 59 | + php-version: '8.4' |
| 60 | + extensions: bcmath, ds, gmp, trader, pdo_sqlite, zip, curl, libxml, dom |
| 61 | + tools: composer:v2, symfony |
| 62 | + |
| 63 | + - name: Create new Symfony project |
| 64 | + run: symfony new test-project --dir=test-project --no-git |
| 65 | + |
| 66 | + - name: Configure and install Stochastix bundle |
| 67 | + working-directory: ./test-project |
| 68 | + run: | |
| 69 | + composer config --no-plugins allow-plugins.williarin/cook true |
| 70 | + composer config repositories.stochastix-core '{"type": "path", "url": "..", "options": {"symlink": false}}' |
| 71 | + composer require stochastix/core:"*@dev" |
| 72 | +
|
| 73 | + - name: Verify recipe installation |
| 74 | + working-directory: ./test-project |
| 75 | + run: | |
| 76 | + echo "--- Verifying config/packages/stochastix.yaml ---" |
| 77 | + test -f config/packages/stochastix.yaml || (echo "File not found!" && exit 1) |
| 78 | + echo "Found." |
| 79 | +
|
| 80 | + echo "--- Verifying config/routes/stochastix.yaml ---" |
| 81 | + test -f config/routes/stochastix.yaml || (echo "File not found!" && exit 1) |
| 82 | + echo "Found." |
| 83 | +
|
| 84 | + echo "--- Verifying data/.gitkeep ---" |
| 85 | + test -f data/.gitkeep || (echo "File not found!" && exit 1) |
| 86 | + echo "Found." |
| 87 | +
|
| 88 | + echo "--- Verifying Makefile ---" |
| 89 | + test -f Makefile || (echo "File not found!" && exit 1) |
| 90 | + echo "Found." |
| 91 | +
|
| 92 | + echo "--- Verifying src/Strategy/SampleStrategy.php ---" |
| 93 | + test -f src/Strategy/SampleStrategy.php || (echo "File not found!" && exit 1) |
| 94 | + echo "Found." |
| 95 | +
|
| 96 | + echo "--- Verifying .env for DATABASE_URL ---" |
| 97 | + grep -q 'DATABASE_URL="sqlite:///%kernel.project_dir%/data/queue_%kernel.environment%.db"' .env || (echo "DATABASE_URL not found or incorrect!" && exit 1) |
| 98 | + echo "Found." |
| 99 | +
|
| 100 | + - name: Setup Database |
| 101 | + working-directory: ./test-project |
| 102 | + run: | |
| 103 | + php bin/console doctrine:database:create --if-not-exists |
| 104 | + php bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration |
0 commit comments