Skip to content

Commit a5dbf51

Browse files
author
arman-bd
committed
build cache
1 parent 438e272 commit a5dbf51

File tree

2 files changed

+54
-3
lines changed

2 files changed

+54
-3
lines changed

.github/workflows/_benchmark.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,25 @@ jobs:
3434
if: runner.os == 'macOS'
3535
run: brew install cmake ninja libnghttp2
3636

37+
- name: Setup ccache (Unix)
38+
if: runner.os != 'Windows'
39+
uses: hendrikmuhs/ccache-action@v1.2
40+
with:
41+
key: ccache-${{ runner.os }}-${{ inputs.primary-python }}
42+
max-size: 500M
43+
44+
- name: Configure ccache (Unix)
45+
if: runner.os != 'Windows'
46+
run: |
47+
echo "CC=ccache gcc" >> $GITHUB_ENV
48+
echo "CXX=ccache g++" >> $GITHUB_ENV
49+
shell: bash
50+
3751
- name: Cache vendor dependencies
3852
uses: actions/cache@v4
3953
with:
4054
path: vendor
41-
key: vendor-${{ runner.os }}-${{ hashFiles('scripts/setup_vendors.sh') }}
55+
key: vendor-${{ runner.os }}-${{ hashFiles('scripts/setup_vendors.sh') }}-v4
4256
restore-keys: |
4357
vendor-${{ runner.os }}-
4458
@@ -47,6 +61,18 @@ jobs:
4761
chmod +x scripts/setup_vendors.sh
4862
./scripts/setup_vendors.sh
4963
64+
- name: Cache Python build artifacts
65+
uses: actions/cache@v4
66+
with:
67+
path: |
68+
build
69+
*.egg-info
70+
**/*.so
71+
**/*.pyd
72+
key: python-build-${{ runner.os }}-${{ inputs.primary-python }}-${{ hashFiles('setup.py', 'pyproject.toml', 'src/**/*.c', 'src/**/*.cpp', 'src/**/*.h') }}
73+
restore-keys: |
74+
python-build-${{ runner.os }}-${{ inputs.primary-python }}-
75+
5076
- name: Install package
5177
run: pip install -e ".[dev,benchmark]"
5278

.github/workflows/_test.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,20 @@ jobs:
5555
if: runner.os == 'Windows'
5656
uses: microsoft/setup-msbuild@v2
5757

58+
- name: Setup ccache (Unix)
59+
if: runner.os != 'Windows'
60+
uses: hendrikmuhs/ccache-action@v1.2
61+
with:
62+
key: ccache-${{ runner.os }}-${{ matrix.python-version }}
63+
max-size: 500M
64+
65+
- name: Configure ccache (Unix)
66+
if: runner.os != 'Windows'
67+
run: |
68+
echo "CC=ccache gcc" >> $GITHUB_ENV
69+
echo "CXX=ccache g++" >> $GITHUB_ENV
70+
shell: bash
71+
5872
- name: Setup vcpkg (Windows)
5973
if: runner.os == 'Windows'
6074
run: |
@@ -80,8 +94,7 @@ jobs:
8094
path: |
8195
C:/vcpkg/installed
8296
C:/vcpkg/packages
83-
C:/vcpkg/buildtrees
84-
key: vcpkg-nghttp2-${{ runner.os }}-v1
97+
key: vcpkg-nghttp2-${{ runner.os }}-v2
8598
restore-keys: |
8699
vcpkg-nghttp2-${{ runner.os }}-
87100
@@ -106,6 +119,18 @@ jobs:
106119
./scripts/setup_vendors.sh
107120
shell: bash
108121

122+
- name: Cache Python build artifacts
123+
uses: actions/cache@v4
124+
with:
125+
path: |
126+
build
127+
*.egg-info
128+
**/*.so
129+
**/*.pyd
130+
key: python-build-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('setup.py', 'pyproject.toml', 'src/**/*.c', 'src/**/*.cpp', 'src/**/*.h') }}
131+
restore-keys: |
132+
python-build-${{ runner.os }}-${{ matrix.python-version }}-
133+
109134
- name: Install package
110135
run: pip install -e ".[dev]"
111136

0 commit comments

Comments
 (0)