Skip to content

Commit 591370b

Browse files
committed
feat(chore): add composer update to the script for local env
1 parent 30ba7f2 commit 591370b

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

.github/actions/setup/action.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@ runs:
4949
path: node_modules
5050
key: node-modules-${{ env.CACHE_VERSION }}-${{ hashFiles('yarn.lock') }}
5151

52-
- name: Run composer update
53-
if: inputs.type != 'minimal'
54-
shell: bash
55-
run: |
56-
composer update --working-dir=clients/algoliasearch-client-php
57-
composer dump-autoload --working-dir=clients/algoliasearch-client-php
58-
5952
- name: Get yarn cache directory path
6053
shell: bash
6154
id: yarn-cache-dir
@@ -71,6 +64,13 @@ runs:
7164
shell: bash
7265
run: YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install
7366

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+
7474
# Computing jobs that should run
7575
- name: Setting diff outputs variables
7676
if: inputs.type == 'matrix'

scripts/common.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,3 +284,14 @@ export async function emptyDirExceptForDotGit(dir: string): Promise<void> {
284284
}
285285
}
286286
}
287+
288+
export async function runComposerUpdate(verbose: boolean): Promise<void> {
289+
if (!CI) {
290+
await run(
291+
'composer update --working-dir=clients/algoliasearch-client-php && composer dump-autoload --working-dir=clients/algoliasearch-client-php',
292+
{
293+
verbose,
294+
}
295+
);
296+
}
297+
}

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: 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
export async function formatter(
@@ -25,6 +25,7 @@ export async function formatter(
2525
&& yarn prettier --write ${folder}`;
2626
break;
2727
case 'php':
28+
await runComposerUpdate(verbose);
2829
cmd = `yarn run prettier ${folder} --write \
2930
&& PHP_CS_FIXER_IGNORE_ENV=1 ${
3031
CI ? 'php' : 'php8'

0 commit comments

Comments
 (0)