Skip to content

Commit 5fdfe37

Browse files
committed
ci: Fix circular dep — composer install --no-scripts before key:generate
1 parent fa44fd8 commit 5fdfe37

3 files changed

Lines changed: 31 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,16 @@ jobs:
5454
${{ runner.os }}-composer-
5555
5656
- name: Create .env for CI
57-
run: |
58-
cp .env.example .env
59-
php artisan key:generate --force
57+
run: cp .env.example .env
6058

61-
- name: Install PHP dependencies
62-
run: composer install --no-interaction --prefer-dist --no-progress
59+
- name: Install PHP dependencies (without scripts)
60+
run: composer install --no-interaction --prefer-dist --no-progress --no-scripts
61+
62+
- name: Generate app key
63+
run: php artisan key:generate --force
64+
65+
- name: Run post-install scripts
66+
run: composer run-script post-autoload-dump --ansi --no-interaction
6367

6468
- name: Run Laravel Pint (Code Style)
6569
run: vendor/bin/pint --test --ansi
@@ -125,12 +129,16 @@ jobs:
125129
coverage: none
126130

127131
- name: Create .env for CI
128-
run: |
129-
cp .env.example .env
130-
php artisan key:generate --force
132+
run: cp .env.example .env
133+
134+
- name: Install PHP dependencies (without scripts)
135+
run: composer install --no-interaction --prefer-dist --no-progress --no-scripts
136+
137+
- name: Generate app key
138+
run: php artisan key:generate --force
131139

132-
- name: Install PHP dependencies
133-
run: composer install --no-interaction --prefer-dist --no-progress
140+
- name: Run post-install scripts
141+
run: composer run-script post-autoload-dump --ansi --no-interaction
134142

135143
- name: Build frontend assets
136144
run: npm run build

.github/workflows/security.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,16 @@ jobs:
7272
coverage: none
7373

7474
- name: Create .env for CI
75-
run: |
76-
cp .env.example .env
77-
php artisan key:generate --force
75+
run: cp .env.example .env
76+
77+
- name: Install PHP dependencies (without scripts)
78+
run: composer install --no-interaction --prefer-dist --no-progress --no-scripts
79+
80+
- name: Generate app key
81+
run: php artisan key:generate --force
7882

79-
- name: Install PHP dependencies
80-
run: composer install --no-interaction --prefer-dist --no-progress
83+
- name: Run post-install scripts
84+
run: composer run-script post-autoload-dump --ansi --no-interaction
8185

8286
- name: Run Composer Audit
8387
run: composer audit --ansi

.github/workflows/supply-chain.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ jobs:
132132
coverage: none
133133

134134
- name: Create .env for CI
135-
run: |
136-
cp .env.example .env
137-
php artisan key:generate --force
135+
run: cp .env.example .env
138136

139137
- name: Fresh PHP install from lockfile
140138
run: |
141139
rm -rf vendor
142-
composer install --no-interaction --prefer-dist --no-progress --optimize-autoloader
140+
composer install --no-interaction --prefer-dist --no-progress --no-scripts
141+
php artisan key:generate --force
142+
composer run-script post-autoload-dump --ansi --no-interaction
143143
echo "✅ Fresh install successful"
144144
145145
- name: Setup Node.js

0 commit comments

Comments
 (0)