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