Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): commit deleted files #692

Merged
merged 1 commit into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/actions/restore-artifacts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ runs:
- name: Unzip clients-javascript artifact
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if output variables from main workflow are available here? We could maybe have some automated ones set to avoid hardcoding paths

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have testsToDelete and path computed at the matrix level, idk if it can help

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can pass the matrix but it would still require to write it for every language, might still be better than this

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually it's an array so it would be a pain to find the correct client with the correct name and then rm, it's easier like that

if: ${{ inputs.javascript == 'true' && inputs.type == 'all' }}
shell: bash
run: unzip -q -o clients-javascript.zip && rm clients-javascript.zip
run: |
rm -rf clients/algoliasearch-client-javascript
rm -rf tests/output/javascript/src/client || true
rm -rf tests/output/javascript/src/methods || true
unzip -q -o clients-javascript.zip && rm clients-javascript.zip

# PHP
- name: Download clients-php artifact
Expand All @@ -74,7 +78,11 @@ runs:
- name: Unzip clients-php artifact
if: ${{ inputs.php == 'true' && inputs.type == 'all' }}
shell: bash
run: unzip -q -o clients-php.zip && rm clients-php.zip
run: |
rm -rf clients/algoliasearch-client-php
rm -rf tests/output/php/src/client || true
rm -rf tests/output/php/src/methods || true
unzip -q -o clients-php.zip && rm clients-php.zip

# Java
- name: Download clients-java artifact
Expand All @@ -86,4 +94,8 @@ runs:
- name: Unzip clients-java artifact
if: ${{ inputs.java == 'true' && inputs.type == 'all' }}
shell: bash
run: unzip -q -o clients-java.zip && rm clients-java.zip
run: |
rm -rf clients/algoliasearch-client-java-2
rm -rf tests/output/java/src/test/java/com/algolia/client || true
rm -rf tests/output/java/src/test/java/com/algolia/methods || true
unzip -q -o clients-java.zip && rm clients-java.zip
4 changes: 3 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ 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.testsToStore }} -x "**/node_modules**" "clients/algoliasearch-client-javascript/.yarn**" "**/.github**"
run:
zip -r -y clients-${{ matrix.client.language }}.zip ${{ matrix.client.path }} ${{ matrix.client.testsToStore }} -x \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the change here only the newline?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some folder to ignore, the java and php artifacts were multiple Mb, now less than 500Kb

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes that's great!!

"**/node_modules**" "clients/algoliasearch-client-javascript/.yarn**" "**/.github**" "**/build/**" "**/dist/**" "**/.gradle/**" "**/bin/**" "**/vendor/**"

- name: Store ${{ matrix.client.language }} clients
uses: actions/upload-artifact@v3
Expand Down
4 changes: 1 addition & 3 deletions scripts/ci/husky/pre-commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ async function preCommit() {
}
}

const stagedFiles = (
await run('git diff --name-only --cached --diff-filter=d')
).split('\n');
const stagedFiles = (await run('git diff --name-only --cached')).split('\n');

const toUnstage = micromatch.match(stagedFiles, getPatterns());

Expand Down