Skip to content

Commit 64b15f7

Browse files
committed
ci: Add custom caching method.
1 parent b00b938 commit 64b15f7

File tree

1 file changed

+85
-30
lines changed

1 file changed

+85
-30
lines changed

.github/workflows/main.yml

Lines changed: 85 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ 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+
run: |
15+
cd ..
16+
export "file_name=NP_mac-arm-${{ hashFiles('build.mac.sh') }}.zip"
17+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
18+
curl -L "$file_url" -o "$file_name" || exit 0
19+
unzip -q "$file_name" || exit 0
20+
rm ${file_name} || exit 0
1921
- name: Uninstall homebrew
2022
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
2123
- name: Run Build
@@ -26,18 +28,29 @@ jobs:
2628
with:
2729
name: Nuitka-Python311_mac_arm64
2830
path: ${{ github.workspace }}/Nuitka-Python-Out
31+
- name: Store cache
32+
run: |
33+
cd ..
34+
export "file_name=NP_mac-arm-${{ hashFiles('build.mac.sh') }}.zip"
35+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
36+
rm -rf ${file_name}
37+
zip -r ${file_name} Nuitka-Python-Deps Nuitka-Python/dep-build
38+
curl -H "x-ms-blob-type: BlockBlob" --upload-file ${file_name} --url "$file_url"
39+
rm -rf ${file_name}
2940
mac_x64:
3041
name: MacOS Intel Build
3142
runs-on: macos-latest
3243
steps:
3344
- name: Check out repository code
3445
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') }}
46+
- name: Download cache
47+
run: |
48+
cd ..
49+
export "file_name=NP_mac-intel-${{ hashFiles('build.mac.sh') }}.zip"
50+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
51+
curl -L "$file_url" -o "$file_name" || exit 0
52+
unzip -q "$file_name" || exit 0
53+
rm ${file_name} || exit 0
4154
- name: Uninstall homebrew
4255
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
4356
- name: Run Build
@@ -48,19 +61,30 @@ jobs:
4861
with:
4962
name: Nuitka-Python311_mac_x86_64
5063
path: ${{ github.workspace }}/Nuitka-Python-Out
64+
- name: Store cache
65+
run: |
66+
cd ..
67+
export "file_name=NP_mac-intel-${{ hashFiles('build.mac.sh') }}.zip"
68+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
69+
rm -rf ${file_name}
70+
zip -r ${file_name} Nuitka-Python-Deps Nuitka-Python/dep-build
71+
curl -H "x-ms-blob-type: BlockBlob" --upload-file ${file_name} --url "$file_url"
72+
rm -rf ${file_name}
5173
5274
mac_arm_no_lto:
5375
name: MacOS ARM Build No LTO
5476
runs-on: macos-latest
5577
steps:
5678
- name: Check out repository code
5779
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') }}
80+
- name: Download cache
81+
run: |
82+
cd ..
83+
export "file_name=NP_mac-arm-no_lto-${{ hashFiles('build.mac.sh') }}.zip"
84+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
85+
curl -L "$file_url" -o "$file_name" || exit 0
86+
unzip -q "$file_name" || exit 0
87+
rm ${file_name} || exit 0
6488
- name: Uninstall homebrew
6589
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
6690
- name: Run Build
@@ -71,18 +95,29 @@ jobs:
7195
with:
7296
name: Nuitka-Python311_mac_arm64_No_LTO
7397
path: ${{ github.workspace }}/Nuitka-Python-Out
98+
- name: Store cache
99+
run: |
100+
cd ..
101+
export "file_name=NP_mac-arm-no_lto-${{ hashFiles('build.mac.sh') }}.zip"
102+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
103+
rm -rf ${file_name}
104+
zip -r ${file_name} Nuitka-Python-Deps Nuitka-Python/dep-build
105+
curl -H "x-ms-blob-type: BlockBlob" --upload-file ${file_name} --url "$file_url"
106+
rm -rf ${file_name}
74107
mac_x64_no_lto:
75108
name: MacOS Intel Build No LTO
76109
runs-on: macos-latest
77110
steps:
78111
- name: Check out repository code
79112
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') }}
113+
- name: Download cache
114+
run: |
115+
cd ..
116+
export "file_name=NP_mac-intel-no_lto-${{ hashFiles('build.mac.sh') }}.zip"
117+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
118+
curl -L "$file_url" -o "$file_name" || exit 0
119+
unzip -q "$file_name" || exit 0
120+
rm ${file_name} || exit 0
86121
- name: Uninstall homebrew
87122
run: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
88123
- name: Run Build
@@ -93,19 +128,30 @@ jobs:
93128
with:
94129
name: Nuitka-Python311_mac_x86_64_No_LTO
95130
path: ${{ github.workspace }}/Nuitka-Python-Out
131+
- name: Store cache
132+
run: |
133+
cd ..
134+
export "file_name=NP_mac-intel-no_lto-${{ hashFiles('build.mac.sh') }}.zip"
135+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
136+
rm -rf ${file_name}
137+
zip -r ${file_name} Nuitka-Python-Deps Nuitka-Python/dep-build
138+
curl -H "x-ms-blob-type: BlockBlob" --upload-file ${file_name} --url "$file_url"
139+
rm -rf ${file_name}
96140
97141
linux:
98142
name: Ubuntu Build
99143
runs-on: ubuntu-latest
100144
steps:
101145
- name: Check out repository code
102146
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') }}
147+
- name: Download cache
148+
run: |
149+
cd ..
150+
export "file_name=NP_ubuntu-${{ hashFiles('build.sh') }}.zip"
151+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
152+
curl -L "$file_url" -o "$file_name" || exit 0
153+
unzip -q "$file_name" || exit 0
154+
rm ${file_name} || exit 0
109155
- name: Run Build
110156
run: bash build.sh "${{ github.workspace }}/Nuitka-Python-Out"
111157
- name: Cleanup artifact
@@ -114,6 +160,15 @@ jobs:
114160
with:
115161
name: Nuitka-Python311_ubuntu
116162
path: ${{ github.workspace }}/Nuitka-Python-Out
163+
- name: Store cache
164+
run: |
165+
cd ..
166+
export "file_name=NP_mac-intel-no_lto-${{ hashFiles('build.sh') }}.zip"
167+
export "file_url=https://nuitkapythonci.blob.core.windows.net/job-cache/${file_name}?${CACHE_SAS}"
168+
rm -rf ${file_name}
169+
zip -r ${file_name} Nuitka-Python-Deps Nuitka-Python/dep-build
170+
curl -H "x-ms-blob-type: BlockBlob" --upload-file ${file_name} --url "$file_url"
171+
rm -rf ${file_name}
117172
118173
windows:
119174
name: Windows Build

0 commit comments

Comments
 (0)