Skip to content

Commit ef40d30

Browse files
authored
Switch back to fetching upstream llvm project (shader-slang#5408)
* backout of commit aa64c85 * Use github token to fetch llvm
1 parent 2055560 commit ef40d30

File tree

1 file changed

+7
-39
lines changed

1 file changed

+7
-39
lines changed

.github/actions/common-setup/action.yml

+7-39
Original file line numberDiff line numberDiff line change
@@ -73,55 +73,23 @@ runs:
7373
echo "bin_dir=$bin_dir" >> "$GITHUB_ENV"
7474
echo "lib_dir=$lib_dir" >> "$GITHUB_ENV"
7575
76-
# Try to restore a LLVM build cache, and build it otherwise
77-
- name: "Restore cache (attempt: 1/2)"
78-
uses: actions/cache/restore@v4
76+
# Try to restore an LLVM install, and build it otherwise
77+
- uses: actions/cache/restore@v4
7978
id: cache-llvm
8079
if: inputs.build-llvm == 'true'
8180
with:
8281
path: ${{ github.workspace }}/build/llvm-project-install
8382
# Use os*compiler*platform in lieu of an ABI key here, which is what we really want
8483
key: llvm-${{ inputs.os }}-${{ inputs.compiler }}-${{ inputs.platform }}-${{ hashFiles('external/build-llvm.sh') }}
85-
86-
# Checkout while waiting for the second try of restoring the cache
87-
- name: Checkout LLVM project if restore cache failed
88-
uses: actions/checkout@v4
89-
id: checkout-llvm
90-
if: inputs.build-llvm == 'true' && steps.cache-llvm.outputs.cache-hit != 'true'
91-
with:
92-
#repository: llvm/llvm-project
93-
repository: shader-slang/llvm-project
94-
ref: llvmorg-13.0.1
95-
path: build/llvm-source
96-
fetch-depth: '1'
97-
fetch-tags: true
98-
99-
# Once the cache server is busy, it usually becomes busy for awhile.
100-
# The second attempt here is more likely to fail again.
101-
# But the overhead of retry is very low, and let's try after spending some time checking out LLVM repo.
102-
- name: "Restore cache (attempt: 2/2)"
103-
uses: actions/cache/restore@v4
104-
id: cache-llvm-2
105-
if: inputs.build-llvm == 'true' && steps.cache-llvm.outputs.cache-hit != 'true'
106-
with:
107-
path: ${{ github.workspace }}/build/llvm-project-install
108-
key: ${{ steps.cache-llvm.outputs.cache-primary-key }}
109-
110-
# Build LLVM only if all attempts of the restoring the cache failed.
11184
- name: Build LLVM
112-
id: build-llvm
113-
if: steps.checkout-llvm.outcome == 'success' && steps.cache-llvm-2.outputs.cache-hit != 'true'
85+
if: inputs.build-llvm == 'true' && steps.cache-llvm.outputs.cache-hit != 'true'
11486
shell: bash
11587
run: |
11688
./external/build-llvm.sh \
117-
--install-prefix "${{ github.workspace }}/build/llvm-project-install" \
118-
--repo "${{github.workspace}}/build/llvm-source" \
119-
--branch llvmorg-13.0.1
120-
121-
# Save LLVM cache if the building step was successful
122-
- name: Save LLVM cache
123-
uses: actions/cache/save@v4
124-
if: steps.build-llvm.outcome == 'success'
89+
--install-prefix "${{github.workspace}}/build/llvm-project-install" \
90+
--repo "https://${{github.token}}@github.com/llvm/llvm-project"
91+
- uses: actions/cache/save@v4
92+
if: inputs.build-llvm == 'true' && steps.cache-llvm.outputs.cache-hit != 'true'
12593
with:
12694
path: ${{ github.workspace }}/build/llvm-project-install
12795
key: ${{ steps.cache-llvm.outputs.cache-primary-key }}

0 commit comments

Comments
 (0)