-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix known issues for cache #1260
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
d31c2dd
Fix issues
Phantsure 7a532d0
Reconfigure catch block
Phantsure 0c23c38
Add debug logging for gzip fall back
Phantsure 0690c10
Fix test
Phantsure d175a18
Add end to end test for cache using bsd on windows
Phantsure bbf5659
Fix test
Phantsure 6bc5dc5
Fix test
Phantsure d7ae8cd
Fix tests
Phantsure cad074c
Add better comments
Phantsure e7e1984
Update packages/cache/src/internal/cacheHttpClient.ts
Phantsure 2d3c79e
Address review comments
Phantsure 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
There are no files selected for viewing
This file contains hidden or 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,91 @@ | ||
| name: cache-windows-bsd-unit-tests | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths-ignore: | ||
| - '**.md' | ||
| pull_request: | ||
| paths-ignore: | ||
| - '**.md' | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build | ||
|
|
||
| runs-on: windows-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - shell: bash | ||
| run: | | ||
| rm "C:\Program Files\Git\usr\bin\tar.exe" | ||
|
|
||
| - name: Set Node.js 12.x | ||
| uses: actions/setup-node@v1 | ||
| with: | ||
| node-version: 12.x | ||
|
|
||
| # In order to save & restore cache from a shell script, certain env variables need to be set that are only available in the | ||
| # node context. This runs a local action that gets and sets the necessary env variables that are needed | ||
| - name: Set env variables | ||
| uses: ./packages/cache/__tests__/__fixtures__/ | ||
|
|
||
| # Need root node_modules because certain npm packages like jest are configured for the entire repository and it won't be possible | ||
| # without these to just compile the cache package | ||
| - name: Install root npm packages | ||
| run: npm ci | ||
|
|
||
| - name: Compile cache package | ||
| run: | | ||
| npm ci | ||
| npm run tsc | ||
| working-directory: packages/cache | ||
|
|
||
| - name: Generate files in working directory | ||
| shell: bash | ||
| run: packages/cache/__tests__/create-cache-files.sh ${{ runner.os }} test-cache | ||
|
|
||
| - name: Generate files outside working directory | ||
| shell: bash | ||
| run: packages/cache/__tests__/create-cache-files.sh ${{ runner.os }} ~/test-cache | ||
|
|
||
| # We're using node -e to call the functions directly available in the @actions/cache package | ||
| - name: Save cache using saveCache() | ||
| run: | | ||
| node -e "Promise.resolve(require('./packages/cache/lib/cache').saveCache(['test-cache','~/test-cache'],'test-${{ runner.os }}-${{ github.run_id }}'))" | ||
|
|
||
| - name: Delete cache folders before restoring | ||
| shell: bash | ||
| run: | | ||
| rm -rf test-cache | ||
| rm -rf ~/test-cache | ||
|
|
||
| - name: Restore cache using restoreCache() with http-client | ||
| run: | | ||
| node -e "Promise.resolve(require('./packages/cache/lib/cache').restoreCache(['test-cache','~/test-cache'],'test-${{ runner.os }}-${{ github.run_id }}',[],{useAzureSdk: false}))" | ||
|
|
||
| - name: Verify cache restored with http-client | ||
| shell: bash | ||
| run: | | ||
| packages/cache/__tests__/verify-cache-files.sh ${{ runner.os }} test-cache | ||
| packages/cache/__tests__/verify-cache-files.sh ${{ runner.os }} ~/test-cache | ||
|
|
||
| - name: Delete cache folders before restoring | ||
| shell: bash | ||
| run: | | ||
| rm -rf test-cache | ||
| rm -rf ~/test-cache | ||
| rm -f cache.tar | ||
|
|
||
| - name: Restore cache using restoreCache() with Azure SDK | ||
| run: | | ||
| node -e "Promise.resolve(require('./packages/cache/lib/cache').restoreCache(['test-cache','~/test-cache'],'test-${{ runner.os }}-${{ github.run_id }}'))" | ||
|
|
||
| - name: Verify cache restored with Azure SDK | ||
| shell: bash | ||
| run: | | ||
| packages/cache/__tests__/verify-cache-files.sh ${{ runner.os }} test-cache | ||
| packages/cache/__tests__/verify-cache-files.sh ${{ runner.os }} ~/test-cache |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.