@@ -73,55 +73,23 @@ runs:
73
73
echo "bin_dir=$bin_dir" >> "$GITHUB_ENV"
74
74
echo "lib_dir=$lib_dir" >> "$GITHUB_ENV"
75
75
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
79
78
id : cache-llvm
80
79
if : inputs.build-llvm == 'true'
81
80
with :
82
81
path : ${{ github.workspace }}/build/llvm-project-install
83
82
# Use os*compiler*platform in lieu of an ABI key here, which is what we really want
84
83
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.
111
84
- 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'
114
86
shell : bash
115
87
run : |
116
88
./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'
125
93
with :
126
94
path : ${{ github.workspace }}/build/llvm-project-install
127
95
key : ${{ steps.cache-llvm.outputs.cache-primary-key }}
0 commit comments