Skip to content

Commit 7f3d6ee

Browse files
authored
feat(ci): move composer udpdate in CI (#495)
1 parent 9e2cc89 commit 7f3d6ee

File tree

5 files changed

+24
-5
lines changed

5 files changed

+24
-5
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ playground
44
build
55
composer.json
66
tsconfig.json
7+
vendor

.github/actions/setup/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ runs:
6464
shell: bash
6565
run: YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install
6666

67+
- name: Run composer update
68+
if: inputs.type != 'minimal'
69+
shell: bash
70+
run: |
71+
composer update --working-dir=clients/algoliasearch-client-php
72+
composer dump-autoload --working-dir=clients/algoliasearch-client-php
73+
6774
# Computing jobs that should run
6875
- name: Setting diff outputs variables
6976
if: inputs.type == 'matrix'

scripts/common.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,3 +277,14 @@ export async function emptyDirExceptForDotGit(dir: string): Promise<void> {
277277
}
278278
}
279279
}
280+
281+
export async function runComposerUpdate(verbose: boolean): Promise<void> {
282+
if (!CI) {
283+
await run(
284+
'composer update --working-dir=clients/algoliasearch-client-php && composer dump-autoload --working-dir=clients/algoliasearch-client-php',
285+
{
286+
verbose,
287+
}
288+
);
289+
}
290+
}

scripts/cts/runCts.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CI, run } from '../common';
1+
import { CI, run, runComposerUpdate } from '../common';
22
import { createSpinner } from '../oraLog';
33

44
async function runCtsOne(language: string, verbose: boolean): Promise<void> {
@@ -16,6 +16,7 @@ async function runCtsOne(language: string, verbose: boolean): Promise<void> {
1616
});
1717
break;
1818
case 'php': {
19+
await runComposerUpdate(verbose);
1920
let php = 'php8';
2021
if (CI) php = 'php';
2122
await run(

scripts/formatter.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { CI, run } from './common';
1+
import { CI, run, runComposerUpdate } from './common';
22
import { createSpinner } from './oraLog';
33

44
export async function formatter(
@@ -25,9 +25,8 @@ export async function formatter(
2525
&& yarn prettier --write ${folder}`;
2626
break;
2727
case 'php':
28-
cmd = `composer update --working-dir=clients/algoliasearch-client-php \
29-
&& composer dump-autoload --working-dir=clients/algoliasearch-client-php \
30-
&& yarn run prettier ${folder} --write \
28+
await runComposerUpdate(verbose);
29+
cmd = `yarn run prettier ${folder} --write \
3130
&& PHP_CS_FIXER_IGNORE_ENV=1 ${
3231
CI ? 'php' : 'php8'
3332
} clients/algoliasearch-client-php/vendor/bin/php-cs-fixer fix ${folder} --using-cache=no --allow-risky=yes`;

0 commit comments

Comments
 (0)