Skip to content

Commit

Permalink
[ci] Fix git cache quirks on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
feisuzhu committed Apr 3, 2023
1 parent 98877df commit cc0cda0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ env:
CI_IMAGE_VERSION: '202303241150'
TI_CI: "1"
TI_SKIP_VERSION_CHECK: 'ON'
TI_USE_GIT_CACHE: ${{ secrets.TI_USE_GIT_CACHE }}
TI_USE_GIT_CACHE: ${{ vars.TI_USE_GIT_CACHE }}


jobs:
Expand Down Expand Up @@ -325,6 +325,14 @@ jobs:
TI_WANTED_ARCHS: "cpu,cuda,opengl,vulkan"
TI_SKIP_VERSION_CHECK: ON

- name: Cleanup Git Cache Configs
shell: pwsh
if: always()
run: |
. .github/workflows/scripts/common-utils.ps1
UnsetGitCachingProxy
exit 0
upload_to_pypi:
name: Upload release to PyPI
needs: [build_and_test_linux, build_and_test_manylinux2014, build_and_test_mac, build_and_test_m1, build_and_test_windows]
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/scripts/common-utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ function UnsetGitCachingProxy {

function SetGitCachingProxy {
Write-Host "Setting up git caching proxy"
Register-EngineEvent -SourceIdentifier PowerShell.Exiting -Action { UnsetGitCachingProxy }
git config --global --add url.http://git-cdn-github.botmaster.tgr/.insteadOf https://github.com/
git config --global --add url.http://git-cdn-github.botmaster.tgr/.insteadOf git@github.com:
git config --global --add url.http://git-cdn-gitlab.botmaster.tgr/.insteadOf https://gitlab.com/
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
TI_LITE_TEST: ${{ github.event_name == 'pull_request' && ! contains(github.event.pull_request.labels.*.name, 'full-ci') && ! startsWith(github.base_ref, 'rc-') && '1' || '' }}
TI_TEST_OFFLINE_CACHE: ${{ github.event.schedule == '0 18 * * *' && '1' || '' }}
CI_IMAGE_VERSION: '202303241150'
TI_USE_GIT_CACHE: ${{ secrets.TI_USE_GIT_CACHE }}
TI_USE_GIT_CACHE: ${{ vars.TI_USE_GIT_CACHE }}

jobs:
show_environ:
Expand Down Expand Up @@ -380,7 +380,7 @@ jobs:
- name: Workaround checkout Needed single revision issue
run: |
git config --system core.longpaths true
git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' || true
git submodule foreach 'git rev-parse HEAD > /dev/null 2>&1 || rm -rf $PWD' # no '|| true' here
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -429,6 +429,14 @@ jobs:
path: dist/*
retention-days: 7

- name: Cleanup Git Cache Configs
shell: pwsh
if: always()
run: |
. .github/workflows/scripts/common-utils.ps1
UnsetGitCachingProxy
exit 0
build_and_test_m1:
name: Build and Test (Apple M1)
needs: check_files
Expand Down

0 comments on commit cc0cda0

Please sign in to comment.