Skip to content

Commit fe37223

Browse files
committed
+ caching
1 parent f0d425c commit fe37223

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ name: True Async Ubuntu Speed Test
33
on:
44
pull_request:
55
branches: [main]
6+
push:
7+
branches: [build]
68

79
jobs:
810
build:
@@ -49,6 +51,15 @@ jobs:
4951
mkdir -p php-src/ext/async
5052
cp -r async/* php-src/ext/async/
5153
54+
# Cache APT packages to speed up dependency installation
55+
- name: Cache APT packages
56+
uses: actions/cache@v4
57+
with:
58+
path: /var/cache/apt/archives
59+
key: ${{ runner.os }}-apt-packages-${{ hashFiles('.github/workflows/build.yml') }}
60+
restore-keys: |
61+
${{ runner.os }}-apt-packages-
62+
5263
- name: Install build dependencies
5364
run: |
5465
sudo apt-get update
@@ -61,10 +72,26 @@ jobs:
6172
firebird-dev \
6273
valgrind cmake
6374
75+
# Cache LibUV 1.44.0 installation to avoid rebuilding
76+
- name: Cache LibUV 1.44.0
77+
id: cache-libuv
78+
uses: actions/cache@v4
79+
with:
80+
path: |
81+
/usr/local/lib/libuv*
82+
/usr/local/include/uv*
83+
/usr/local/lib/pkgconfig/libuv.pc
84+
key: ${{ runner.os }}-libuv-1.44.0-release
85+
6486
- name: Install LibUV >= 1.44.0
6587
run: |
88+
# Check if we have cached LibUV 1.44.0
89+
if [ "${{ steps.cache-libuv.outputs.cache-hit }}" == "true" ]; then
90+
echo "Using cached LibUV 1.44.0 installation"
91+
sudo ldconfig
92+
echo "LibUV version: $(pkg-config --modversion libuv)"
6693
# Check if system libuv meets requirements
67-
if pkg-config --exists libuv && pkg-config --atleast-version=1.44.0 libuv; then
94+
elif pkg-config --exists libuv && pkg-config --atleast-version=1.44.0 libuv; then
6895
echo "System libuv version: $(pkg-config --modversion libuv)"
6996
sudo apt-get install -y libuv1-dev
7097
else
@@ -78,6 +105,7 @@ jobs:
78105
sudo make install
79106
sudo ldconfig
80107
cd ../..
108+
echo "LibUV 1.44.0 compiled and installed"
81109
fi
82110
83111
- name: Configure PHP

0 commit comments

Comments
 (0)