Skip to content

Commit 0b67e17

Browse files
committed
ci: Add custom caching method.
1 parent b00b938 commit 0b67e17

File tree

1 file changed

+105
-30
lines changed

1 file changed

+105
-30
lines changed

.github/workflows/main.yml

+105-30
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@ jobs:
1010
steps:
1111
- name: Check out repository code
1212
uses: actions/checkout@v4
13-
- uses: actions/cache@v4
14-
with:
15-
path: |
16-
${{ github.workspace }}/../Nuitka-Python-Deps
17-
dep-build
18-
key: ${{ runner.os }}-arm-${{ hashFiles('build.mac.sh') }}
13+
- name: Download cache
14+
env:
15+
CACHE_SAS: ${{ secrets.CACHE_SAS }}
16+
run: |
17+
cd ..
18+
export "file_name=NP_mac-arm-${{ hashFiles('build.mac.sh') }}.zip"
19+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
20+
curl -L "$file_url" -o "$file_name" || exit 0
21+
unzip -q "$file_name" || exit 0
22+
rm ${file_name} || exit 0
1923
- name: Uninstall homebrew
2024
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
2125
- name: Run Build
@@ -26,18 +30,33 @@ jobs:
2630
with:
2731
name: Nuitka-Python311_mac_arm64
2832
path: ${{ github.workspace }}/Nuitka-Python-Out
33+
- name: Store cache
34+
env:
35+
CACHE_SAS: ${{ secrets.CACHE_SAS }}
36+
run: |
37+
cd ..
38+
export "file_name=NP_mac-arm-${{ hashFiles('build.mac.sh') }}.zip"
39+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
40+
rm -rf ${file_name}
41+
zip -r ${file_name} Nuitka-Python-Deps Nuitka-Python/dep-build
42+
curl -H "x-ms-blob-type: BlockBlob" --upload-file ${file_name} --url "$file_url"
43+
rm -rf ${file_name}
2944
mac_x64:
3045
name: MacOS Intel Build
3146
runs-on: macos-latest
3247
steps:
3348
- name: Check out repository code
3449
uses: actions/checkout@v4
35-
- uses: actions/cache@v4
36-
with:
37-
path: |
38-
${{ github.workspace }}/Nuitka-Python-Deps
39-
dep-build
40-
key: ${{ runner.os }}-intel-${{ hashFiles('build.mac.sh') }}
50+
- name: Download cache
51+
env:
52+
CACHE_SAS: ${{ secrets.CACHE_SAS }}
53+
run: |
54+
cd ..
55+
export "file_name=NP_mac-intel-${{ hashFiles('build.mac.sh') }}.zip"
56+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
57+
curl -L "$file_url" -o "$file_name" || exit 0
58+
unzip -q "$file_name" || exit 0
59+
rm ${file_name} || exit 0
4160
- name: Uninstall homebrew
4261
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
4362
- name: Run Build
@@ -48,19 +67,34 @@ jobs:
4867
with:
4968
name: Nuitka-Python311_mac_x86_64
5069
path: ${{ github.workspace }}/Nuitka-Python-Out
70+
- name: Store cache
71+
env:
72+
CACHE_SAS: ${{ secrets.CACHE_SAS }}
73+
run: |
74+
cd ..
75+
export "file_name=NP_mac-intel-${{ hashFiles('build.mac.sh') }}.zip"
76+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
77+
rm -rf ${file_name}
78+
zip -r ${file_name} Nuitka-Python-Deps Nuitka-Python/dep-build
79+
curl -H "x-ms-blob-type: BlockBlob" --upload-file ${file_name} --url "$file_url"
80+
rm -rf ${file_name}
5181
5282
mac_arm_no_lto:
5383
name: MacOS ARM Build No LTO
5484
runs-on: macos-latest
5585
steps:
5686
- name: Check out repository code
5787
uses: actions/checkout@v4
58-
- uses: actions/cache@v4
59-
with:
60-
path: |
61-
${{ github.workspace }}/../Nuitka-Python-Deps
62-
dep-build
63-
key: ${{ runner.os }}-arm-no_lto-${{ hashFiles('build.mac.sh') }}
88+
- name: Download cache
89+
env:
90+
CACHE_SAS: ${{ secrets.CACHE_SAS }}
91+
run: |
92+
cd ..
93+
export "file_name=NP_mac-arm-no_lto-${{ hashFiles('build.mac.sh') }}.zip"
94+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
95+
curl -L "$file_url" -o "$file_name" || exit 0
96+
unzip -q "$file_name" || exit 0
97+
rm ${file_name} || exit 0
6498
- name: Uninstall homebrew
6599
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
66100
- name: Run Build
@@ -71,18 +105,33 @@ jobs:
71105
with:
72106
name: Nuitka-Python311_mac_arm64_No_LTO
73107
path: ${{ github.workspace }}/Nuitka-Python-Out
108+
- name: Store cache
109+
env:
110+
CACHE_SAS: ${{ secrets.CACHE_SAS }}
111+
run: |
112+
cd ..
113+
export "file_name=NP_mac-arm-no_lto-${{ hashFiles('build.mac.sh') }}.zip"
114+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
115+
rm -rf ${file_name}
116+
zip -r ${file_name} Nuitka-Python-Deps Nuitka-Python/dep-build
117+
curl -H "x-ms-blob-type: BlockBlob" --upload-file ${file_name} --url "$file_url"
118+
rm -rf ${file_name}
74119
mac_x64_no_lto:
75120
name: MacOS Intel Build No LTO
76121
runs-on: macos-latest
77122
steps:
78123
- name: Check out repository code
79124
uses: actions/checkout@v4
80-
- uses: actions/cache@v4
81-
with:
82-
path: |
83-
${{ github.workspace }}/Nuitka-Python-Deps
84-
dep-build
85-
key: ${{ runner.os }}-intel-no_lto-${{ hashFiles('build.mac.sh') }}
125+
- name: Download cache
126+
env:
127+
CACHE_SAS: ${{ secrets.CACHE_SAS }}
128+
run: |
129+
cd ..
130+
export "file_name=NP_mac-intel-no_lto-${{ hashFiles('build.mac.sh') }}.zip"
131+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
132+
curl -L "$file_url" -o "$file_name" || exit 0
133+
unzip -q "$file_name" || exit 0
134+
rm ${file_name} || exit 0
86135
- name: Uninstall homebrew
87136
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
88137
- name: Run Build
@@ -93,19 +142,34 @@ jobs:
93142
with:
94143
name: Nuitka-Python311_mac_x86_64_No_LTO
95144
path: ${{ github.workspace }}/Nuitka-Python-Out
145+
- name: Store cache
146+
env:
147+
CACHE_SAS: ${{ secrets.CACHE_SAS }}
148+
run: |
149+
cd ..
150+
export "file_name=NP_mac-intel-no_lto-${{ hashFiles('build.mac.sh') }}.zip"
151+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
152+
rm -rf ${file_name}
153+
zip -r ${file_name} Nuitka-Python-Deps Nuitka-Python/dep-build
154+
curl -H "x-ms-blob-type: BlockBlob" --upload-file ${file_name} --url "$file_url"
155+
rm -rf ${file_name}
96156
97157
linux:
98158
name: Ubuntu Build
99159
runs-on: ubuntu-latest
100160
steps:
101161
- name: Check out repository code
102162
uses: actions/checkout@v4
103-
- uses: actions/cache@v4
104-
with:
105-
path: |
106-
${{ github.workspace }}/../Nuitka-Python-Deps
107-
dep-build
108-
key: ${{ runner.os }}-${{ hashFiles('build.sh') }}
163+
- name: Download cache
164+
env:
165+
CACHE_SAS: ${{ secrets.CACHE_SAS }}
166+
run: |
167+
cd ..
168+
export "file_name=NP_ubuntu-${{ hashFiles('build.sh') }}.zip"
169+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
170+
curl -L "$file_url" -o "$file_name" || exit 0
171+
unzip -q "$file_name" || exit 0
172+
rm ${file_name} || exit 0
109173
- name: Run Build
110174
run: bash build.sh "${{ github.workspace }}/Nuitka-Python-Out"
111175
- name: Cleanup artifact
@@ -114,6 +178,17 @@ jobs:
114178
with:
115179
name: Nuitka-Python311_ubuntu
116180
path: ${{ github.workspace }}/Nuitka-Python-Out
181+
- name: Store cache
182+
env:
183+
CACHE_SAS: ${{ secrets.CACHE_SAS }}
184+
run: |
185+
cd ..
186+
export "file_name=NP_mac-intel-no_lto-${{ hashFiles('build.sh') }}.zip"
187+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
188+
rm -rf ${file_name}
189+
zip -r ${file_name} Nuitka-Python-Deps Nuitka-Python/dep-build
190+
curl -H "x-ms-blob-type: BlockBlob" --upload-file ${file_name} --url "$file_url"
191+
rm -rf ${file_name}
117192
118193
windows:
119194
name: Windows Build

0 commit comments

Comments
 (0)