-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Add cache checkout script to docker containers (#5184)
Add a new cache checkout script to docker containers. General idea is to keep a local copy of repository and re-use existing objects to avoid long clone times. Also add zstd to experiment with LLVM compression times and psutil, which is required to kill tests by timeout.
- Loading branch information
1 parent
b7cee06
commit 2c7573d
Showing
4 changed files
with
48 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: 'Cached checkout' | ||
description: 'Checkout a git repository using local cache if possible' | ||
inputs: | ||
repository: | ||
description: 'Repository name with owner' | ||
default: ${{ github.repository }} | ||
ref: | ||
description: 'Commit-ish to checkout' | ||
path: | ||
description: 'Path to checkout repo to' | ||
fetch-depth: | ||
description: 'Number of commits to fetch' | ||
default: 1 | ||
cache_path: | ||
description: 'Path to cache location for all repos' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Fetch cache | ||
shell: bash | ||
run: | | ||
mkdir -p ${{ inputs.cache_path }}/${{ inputs.repository }} | ||
cd ${{ inputs.cache_path }}/${{ inputs.repository }} | ||
if [ -d ./.git ]; then | ||
git pull | ||
else | ||
git clone https://github.com/${{ inputs.repository }}.git . | ||
fi | ||
chown -R sycl:sycl ${{ inputs.cache_path }}/${{ inputs.repository }} | ||
- name: Checkout | ||
env: | ||
GIT_ALTERNATE_OBJECT_DIRECTORIES: ${{ inputs.cache_path }}/${{ inputs.repository }}/.git/objects | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ inputs.repository }} | ||
ref: ${{ inputs.ref }} | ||
path: ${{ inputs.path }} | ||
fetch-depth: ${{ inputs.fetch-depth }} |
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