Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ jobs:
run: yarn cli build clients ${{ matrix.client.language }} ${{ matrix.client.toRun }}

- name: Clean CTS output before generate
run: rm -rf ${{ matrix.client.testsOutputPath }} || true
run: rm -rf ${{ matrix.client.testsToDelete }} || true

- name: Generate CTS
run: yarn cli cts generate ${{ matrix.client.language }} ${{ matrix.client.toRun }}
Expand All @@ -230,7 +230,7 @@ jobs:
run: yarn cli cts run ${{ matrix.client.language }}

- name: Zip artifact before storing
run: zip -r -y clients-${{ matrix.client.language }}.zip ${{ matrix.client.path }} ${{ matrix.client.testsOutputPath }} -x "**/node_modules/**" "**/node_modules/.**" "clients/algoliasearch-client-javascript/.yarn/**"
run: zip -r -y clients-${{ matrix.client.language }}.zip ${{ matrix.client.path }} ${{ matrix.client.testsToStore }} -x "**/node_modules/**" "**/node_modules/.**" "clients/algoliasearch-client-javascript/.yarn/**"

- name: Store ${{ matrix.client.language }} clients
uses: actions/upload-artifact@v3
Expand Down
8 changes: 7 additions & 1 deletion scripts/ci/githubActions/createMatrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ async function getClientMatrix(baseBranch: string): Promise<void> {
const testOutputBase = `./tests/output/${language}/${getTestOutputFolder(
language
)}`;
const testsToDelete = `${testOutputBase}/client ${testOutputBase}/methods`;
const testsToStore =
language === 'javascript'
? `${testsToDelete} ./tests/output/${language}/package.json`
: testsToDelete;

clientMatrix.client.push({
language,
Expand All @@ -97,7 +102,8 @@ async function getClientMatrix(baseBranch: string): Promise<void> {
`templates/${language}`,
`generators/src`,
]),
testsOutputPath: `${testOutputBase}/client ${testOutputBase}/methods`,
testsToDelete,
testsToStore,
});
console.log(`::set-output name=RUN_GEN_${language.toUpperCase()}::true`);
}
Expand Down
8 changes: 6 additions & 2 deletions scripts/ci/githubActions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ export type ClientMatrix = BaseMatrix & {
*/
language: string;
/**
* The test output path to clean.
* The test output path to delete before running the CTS generation.
*/
testsOutputPath: string;
testsToDelete: string;
/**
* The test output path to store in the artifact.
*/
testsToStore: string;
};

export type SpecMatrix = BaseMatrix & {
Expand Down