Skip to content

Commit 04fec5d

Browse files
authored
Merge pull request #5 from haturatu/feat/build-cache
feat: add build cache
2 parents d98722c + 967460a commit 04fec5d

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/workflow.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ jobs:
100100
- os: ubuntu-latest
101101
asset-name: hl-linux-x86_64
102102
output-name: hl
103-
install-system-tools: sudo apt-get update && sudo apt-get install -y patchelf
103+
install-system-tools: sudo apt-get update && sudo apt-get install -y patchelf ccache
104104
- os: ubuntu-24.04-arm
105105
asset-name: hl-linux-arm64
106106
output-name: hl
107-
install-system-tools: sudo apt-get update && sudo apt-get install -y patchelf
107+
install-system-tools: sudo apt-get update && sudo apt-get install -y patchelf ccache
108108
- os: macos-latest
109109
asset-name: hl-macos-arm64
110110
output-name: hl
@@ -130,15 +130,32 @@ jobs:
130130
cache: pip
131131
cache-dependency-path: pyproject.toml
132132

133+
# Nuitka stores generated C compilation results below this directory. Persist
134+
# it between workflow runs so unchanged dependencies do not get rebuilt.
135+
- name: Restore Nuitka compilation cache
136+
uses: actions/cache@v4
137+
with:
138+
path: .nuitka-cache
139+
key: nuitka-${{ runner.os }}-${{ matrix.asset-name }}-py312-${{ hashFiles('pyproject.toml', '.github/workflows/workflow.yml') }}
140+
restore-keys: |
141+
nuitka-${{ runner.os }}-${{ matrix.asset-name }}-py312-
142+
133143
- name: Install system build tools
134144
if: matrix.install-system-tools != ''
135145
shell: bash
136146
run: ${{ matrix.install-system-tools }}
137147

148+
- name: Install macOS compiler cache
149+
if: runner.os == 'macOS'
150+
shell: bash
151+
run: brew install ccache
152+
138153
- name: Install Python build tools
139154
run: python -m pip install --upgrade pip nuitka zstandard
140155

141156
- name: Build single binary
157+
env:
158+
NUITKA_CACHE_DIR: ${{ github.workspace }}/.nuitka-cache
142159
shell: bash
143160
run: |
144161
python -m pip install --upgrade -e .

0 commit comments

Comments
 (0)