8
8
jobs :
9
9
linux-aarch64 :
10
10
if : 1
11
- runs-on : ubuntu-latest
11
+ runs-on : ubuntu-24.04-arm
12
12
strategy :
13
13
matrix :
14
14
php-version :
31
31
uname -s
32
32
uname -m
33
33
uname -r
34
+
35
+ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
36
+ cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
37
+ cat /proc/cpuinfo | grep "cpu cores" | uniq
38
+ cat /proc/cpuinfo| grep "processor"| wc -l
39
+ lscpu
40
+
34
41
export IPV6=$(ip -6 address show | grep inet6 | awk '{print $2}' | cut -d'/' -f1 | sed -n '2p')
35
42
export IPV4=$(ip -4 address show | grep inet | grep -v 127.0.0 | awk '{print $2}' | cut -d'/' -f1 | sed -n '1p')
36
43
echo $IPV4
@@ -50,14 +57,14 @@ jobs:
50
57
51
58
- name : Cache PHP Runtime
52
59
uses : actions/cache@v4
53
- id : php-runtime-cache
60
+ id : php-runtime-cache-aarch64
54
61
with :
55
62
path : ${{ github.workspace }}/bin/runtime
56
63
key : ${{ runner.os }}-aarch64-php-runtime
57
64
58
65
- name : Cache PHP Vendor
59
66
uses : actions/cache@v4
60
- id : php-vendor-cache
67
+ id : php-vendor-cache-aarch64
61
68
with :
62
69
path : ${{ github.workspace }}/vendor
63
70
key : ${{ runner.os }}-aarch64-php-vendor
@@ -71,35 +78,18 @@ jobs:
71
78
72
79
- name : Cache all-library
73
80
uses : actions/cache@v4
74
- id : all-library-cache
81
+ id : all-library-cache-aarch64
75
82
with :
76
83
path : /usr/local/swoole-cli
77
84
key : ${{ github.head_ref || github.ref_name }}-${{ runner.os }}-aarch64-all-library
78
85
79
86
- name : Cache swoole-cli-builder-image
80
87
uses : actions/cache@v4
81
- id : swoole-cli-builder-image-aarch64- cache
88
+ id : swoole-cli-builder-image-cache-aarch64
82
89
with :
83
90
path : ${{ github.workspace }}/var/build-github-action-container/swoole-cli-builder-image.tar
84
91
key : ${{ runner.os }}-aarch64-swoole-cli-builder-image
85
92
86
- - name : Prepare Libraries and Extensions
87
- run : |
88
- set -x
89
- mkdir -p pool/lib
90
- mkdir -p pool/ext
91
- mkdir -p bin/runtime
92
-
93
- bash sapi/download-box/download-box-get-archive-from-server.sh
94
-
95
- ls -A pool/lib/
96
- ls -A /usr/local/swoole-cli/
97
-
98
- - name : Prepare QEMU
99
- run : |
100
- set -x
101
- sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
102
-
103
93
- name : Prepare swoole-cli-builder-image
104
94
run : |
105
95
if [ -f ${{ github.workspace }}/var/build-github-action-container/swoole-cli-builder-image.tar ] ; then
@@ -108,19 +98,18 @@ jobs:
108
98
bash .github/workflows/build-alpine-builder-container.sh --platform "linux/arm64"
109
99
fi
110
100
111
- - name : prepare pre-built library
112
- uses : addnab/docker-run-action@v3
113
- with :
114
- image : docker.io/jingjingxyk/build-swoole-cli:all-dependencies-alpine-3.18-php8-v1.0.0-aarch64-20240618T091126Z
115
- options : -v ${{ github.workspace }}:/work -w /work -v /usr/local/swoole-cli/:/usr/local/tmp/
116
- run : |
117
- for i in `ls /usr/local/swoole-cli/`
118
- do
119
- if [ ! -d /usr/local/tmp/${i} ] ; then
120
- echo $i
121
- cp -rf /usr/local/swoole-cli/${i}/ /usr/local/tmp/${i}
122
- fi
123
- done
101
+ - name : Prepare Runtime and Libraries and Extensions
102
+ run : |
103
+ set -x
104
+ mkdir -p pool/lib
105
+ mkdir -p pool/ext
106
+ mkdir -p bin/runtime
107
+ if [ ! -f bin/runtime/php ] ; then
108
+ bash setup-php-runtime.sh
109
+ fi
110
+ bash sapi/download-box/download-box-get-archive-from-server.sh
111
+ ls -A pool/lib/
112
+ ls -A /usr/local/swoole-cli/
124
113
125
114
- name : Build
126
115
uses : addnab/docker-run-action@v3
@@ -130,10 +119,6 @@ jobs:
130
119
run : |
131
120
set -eux
132
121
uname -m
133
- if [ ! -f bin/runtime/php ] ; then
134
- bash setup-php-runtime.sh
135
- fi
136
-
137
122
export PATH=/work/bin/runtime:$PATH # 容器已经内置 php 和 composer
138
123
alias php="php -d curl.cainfo=/work/bin/runtime/cacert.pem -d openssl.cafile=/work/bin/runtime/cacert.pem"
139
124
@@ -149,31 +134,27 @@ jobs:
149
134
150
135
bash make-install-deps.sh
151
136
152
- bash make.sh all-library
137
+ bash ./ make.sh all-library
153
138
154
- bash make.sh config
155
- bash make.sh build
156
- bash make.sh archive
139
+ bash ./ make.sh config
140
+ bash ./ make.sh build
141
+ bash ./ make.sh archive
157
142
158
143
- name : Show Build Result
159
- uses : addnab/docker-run-action@v3
160
- with :
161
- image : swoole-cli-builder:latest
162
- options : -v ${{ github.workspace }}:/work -w /work
163
- run : |
164
- ./thirdparty/php-src/sapi/cli/php -v
165
- ./thirdparty/php-src/sapi/cli/php -m
166
- ./thirdparty/php-src/sapi/cli/php --ri gd
167
- ./thirdparty/php-src/sapi/cli/php --ri swoole
168
- ./thirdparty/php-src/sapi/cli/php --ri pgsql
169
- file ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php
170
- readelf -h ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php
171
- APP_VERSION=$(./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php -v | head -n 1 | awk '{print $2}')
172
- echo ${APP_VERSION}
173
- echo ${APP_VERSION} > APP_VERSION
174
- ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php -r "echo PHP_VERSION;"
175
- ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php ./vendor/bin/phpunit ./sapi/src/UnitTest/MainTest.php --list-tests
176
- ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php ./vendor/bin/phpunit ./sapi/src/UnitTest/MainTest.php
144
+ run : |
145
+ ./thirdparty/php-src/sapi/cli/php -v
146
+ ./thirdparty/php-src/sapi/cli/php -m
147
+ ./thirdparty/php-src/sapi/cli/php --ri gd
148
+ ./thirdparty/php-src/sapi/cli/php --ri swoole
149
+ ./thirdparty/php-src/sapi/cli/php --ri pgsql
150
+ file ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php
151
+ readelf -h ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php
152
+ APP_VERSION=$(./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php -v | head -n 1 | awk '{print $2}')
153
+ echo ${APP_VERSION}
154
+ echo ${APP_VERSION} > APP_VERSION
155
+ ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php -r "echo PHP_VERSION;"
156
+ ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php ./vendor/bin/phpunit ./sapi/src/UnitTest/MainTest.php --list-tests
157
+ ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php ./vendor/bin/phpunit ./sapi/src/UnitTest/MainTest.php
177
158
178
159
- name : get app version
179
160
run : |
@@ -186,14 +167,14 @@ jobs:
186
167
with :
187
168
name : php-cli-v${{ env.APP_VERSION }}-linux-arm64-debug
188
169
retention-days : 90
189
- path : ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/php
170
+ path : ./bin/php-${{ env.APP_VERSION }}/bin/php
190
171
191
172
- name : production artifacts
192
173
uses : actions/upload-artifact@v4
193
174
with :
194
175
name : php-cli-v${{ env.APP_VERSION }}-linux-arm64
195
176
retention-days : 90
196
- path : ./bin/php-${{ env.BUILD_PHP_VERSION }}/bin/dist/php
177
+ path : ./bin/php-${{ env.APP_VERSION }}/bin/dist/php
197
178
198
179
- name : gh release
199
180
uses : softprops/action-gh-release@v2
0 commit comments