Skip to content

Commit

Permalink
make it work for all revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry committed Aug 21, 2024
1 parent 43ce3fc commit 41a11bb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
6 changes: 0 additions & 6 deletions .dvc/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
/config.local
/tmp
/cache
/updater
/lock
/updater.lock
/state-journal
/state-wal
/state
18 changes: 13 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ jobs:
ref: ${{ env.DVC_REF }}
path: dvc
fetch-depth: 0
- run: ../dvc-bench/scripts/ci/fetch-all-revs.sh "${REVS}"
working-directory: dvc
- uses: hynek/setup-cached-uv@v2
with:
cache-dependency-path: dvc/pyproject.toml
Expand All @@ -159,7 +161,7 @@ jobs:
- uses: actions/cache/restore@v4
id: restore-cache
with:
path: .dvc/cache
path: dvc-bench/.dvc/cache
key: ${{ env.DATASET }}
- name: run benchmarks
shell: bash
Expand All @@ -174,7 +176,7 @@ jobs:
- if: ${{ steps.restore-cache.outputs.cache-hit != 'true' && matrix.test.name == 'test_add_copy' }}
uses: actions/cache/save@v4
with:
path: .dvc/cache
path: dvc-bench/.dvc/cache
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
- name: upload raw results
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -215,6 +217,8 @@ jobs:
ref: ${{ env.DVC_REF }}
path: dvc
fetch-depth: 0
- run: ../dvc-bench/scripts/ci/fetch-all-revs.sh "${REVS}"
working-directory: dvc
- uses: actions/checkout@v4
with:
repository: ${{ env.DVC_S3_REPOSITORY }}
Expand All @@ -230,7 +234,7 @@ jobs:
run: uv pip install "./dvc[tests]" "./dvc-s3[tests]"
- uses: actions/cache/restore@v4
with:
path: .dvc/cache
path: dvc-bench/.dvc/cache
key: ${{ env.DATASET }}
- name: configure real S3 DVC env
if: ${{ github.event_name == 'schedule' }}
Expand Down Expand Up @@ -280,6 +284,8 @@ jobs:
ref: ${{ env.DVC_REF }}
path: dvc
fetch-depth: 0
- run: ../dvc-bench/scripts/ci/fetch-all-revs.sh "${REVS}"
working-directory: dvc
- uses: actions/checkout@v4
with:
repository: ${{ env.DVC_AZURE_REPOSITORY }}
Expand Down Expand Up @@ -309,7 +315,7 @@ jobs:
run: uv pip install "./dvc[tests]" "./dvc-azure[tests]"
- uses: actions/cache/restore@v4
with:
path: .dvc/cache
path: dvc-bench/.dvc/cache
key: ${{ env.DATASET }}
- name: setup env
if: ${{ github.event_name == 'schedule' }}
Expand Down Expand Up @@ -358,6 +364,8 @@ jobs:
ref: ${{ env.DVC_REF }}
path: dvc
fetch-depth: 0
- run: ../dvc-bench/scripts/ci/fetch-all-revs.sh "${REVS}"
working-directory: dvc
- uses: actions/checkout@v4
with:
repository: ${{ env.DVC_GS_REPOSITORY }}
Expand All @@ -373,7 +381,7 @@ jobs:
run: uv pip install "./dvc[tests]" "./dvc-gs[tests]"
- uses: actions/cache/restore@v4
with:
path: .dvc/cache
path: dvc-bench/.dvc/cache
key: ${{ env.DATASET }}
- id: 'auth'
if: ${{ github.event_name == 'schedule' }}
Expand Down
10 changes: 10 additions & 0 deletions scripts/ci/fetch-all-revs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/bash

# Create local branch for all revs except the current branch and tags
# All the branches are assumed to have been fetched from the remote already.
IFS=',' read -r -a branch_array <<< "$1"
for branch in "${branch_array[@]}"; do
if ! git rev-parse --verify $branch &>/dev/null; then
git branch "${branch}" origin/"${branch}"
fi
done

0 comments on commit 41a11bb

Please sign in to comment.