-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: update caching to resolve concurrency (#2869)
* ci: update caching to resolve concurrency * Apply suggestions from code review --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
d9697b6
commit f7235c9
Showing
7 changed files
with
147 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Collect new packages and upload cache | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
pypi-key: | ||
description: cache restore/dump key | ||
required: false | ||
type: string | ||
default: "pypi-packages" | ||
pypi-dir: | ||
description: location of local PyPI cache | ||
required: false | ||
type: string | ||
default: "_ci-cache_PyPI" | ||
cache-artifact-appendix: | ||
description: "unique name for the job" | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
merge-caches: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download 📥 artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: ${{ inputs.pypi-key }}-run-${{ inputs.cache-artifact-appendix }}* | ||
merge-multiple: true | ||
path: _local-packages | ||
- name: Cache pull packages | ||
uses: actions/cache/restore@v3 | ||
with: | ||
enableCrossOsArchive: true | ||
path: ${{ inputs.pypi-dir }} | ||
key: ${{ inputs.pypi-key }} | ||
|
||
- name: show 📦 | ||
run: | | ||
# create the directory if it doesn't exist - no artifact were found | ||
mkdir -p _local-packages | ||
ls -lh _local-packages | ||
ls -lh ${{ inputs.pypi-dir }} | ||
# count files in the staging dir | ||
file_count=$(ls -1 "_local-packages/" | wc -l) | ||
echo "NUM_PACKAGES=$file_count" >> $GITHUB_ENV | ||
- name: Move collected 📦 | ||
if: env.NUM_PACKAGES != 0 | ||
run: mv _local-packages/* ${{ inputs.pypi-dir }} | ||
|
||
- name: Cache push packages | ||
if: env.NUM_PACKAGES != 0 | ||
uses: actions/cache/save@v3 | ||
with: | ||
enableCrossOsArchive: true | ||
path: ${{ inputs.pypi-dir }} | ||
key: ${{ inputs.pypi-key }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
"We couldn't connect to", | ||
"Connection error", | ||
"Can't load", | ||
"`nltk` resource `punkt` is", | ||
) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters