1010 workflow_dispatch :
1111
1212jobs :
13- build-and- test :
13+ build-test-x86 :
1414 runs-on : ubuntu-latest
15- strategy :
16- fail-fast : false
17- matrix :
18- architecture : [x86_64, aarch64]
15+ container :
16+ image : ubuntu:22.04
1917
2018 steps :
2119 - uses : actions/checkout@v3
20+ - name : Install prerequisites
21+ run : |
22+ apt update
23+ apt install -y build-essential g++ make cmake pkg-config git wget curl zip unzip tar
24+ - name : Install vcpkg
25+ run : |
26+ git clone https://github.com/microsoft/vcpkg.git /opt/vcpkg
27+ /opt/vcpkg/bootstrap-vcpkg.sh
28+ ln -s /opt/vcpkg/vcpkg /usr/local/bin/vcpkg
29+ - name : Clone project repository
30+ run : |
31+ git clone https://github.com/lk-libs/libcpp-http-client.git /root/libcpp-http-client
32+ - name : Run cmake with vcpkg toolchain
33+ run : |
34+ cd /root/libcpp-http-client
35+ cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake
36+ - name : Build the project
37+ run : |
38+ cd /root/libcpp-http-client
39+ cmake --build build --config Release
40+ - name : Run tests
41+ run : |
42+ cd /root/libcpp-http-client
43+ ./build/test/test
2244
23- - name : Set up QEMU
24- if : matrix.architecture == 'aarch64'
25- uses : docker/setup-qemu-action@v1
26- with :
27- platforms : all
28-
29- - name : Set up Docker Buildx
30- uses : docker/setup-buildx-action@v1
31-
32- - name : Available platforms
33- run : echo ${{ steps.buildx.outputs.platforms }}
45+ build-test-aarch64 :
46+ needs : build-test-x86
47+ runs-on : ubuntu-latest
48+ container :
49+ image : arm64v8/ubuntu:22.04
3450
51+ steps :
52+ - uses : actions/checkout@v3
3553 - name : Install prerequisites
3654 run : |
3755 apt update
38- apt full-upgrade -y
39- apt auto-remove -y
4056 apt install -y build-essential g++ make cmake pkg-config git wget curl zip unzip tar
41-
4257 - name : Install vcpkg
4358 run : |
4459 git clone https://github.com/microsoft/vcpkg.git /opt/vcpkg
4560 /opt/vcpkg/bootstrap-vcpkg.sh
4661 ln -s /opt/vcpkg/vcpkg /usr/local/bin/vcpkg
47-
4862 - name : Clone project repository
4963 run : |
5064 git clone https://github.com/lk-libs/libcpp-http-client.git /root/libcpp-http-client
51-
5265 - name : Run cmake with vcpkg toolchain
5366 run : |
5467 cd /root/libcpp-http-client
5568 cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake
56-
5769 - name : Build the project
5870 run : |
5971 cd /root/libcpp-http-client
6072 cmake --build build --config Release
61-
6273 - name : Run tests
6374 run : |
6475 cd /root/libcpp-http-client
65- ./build/test/test
76+ ./build/test/test
0 commit comments