Skip to content

Commit 0075b21

Browse files
author
Levent KARAGÖL
committed
test.yml has been updated
1 parent 91026ad commit 0075b21

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

.github/workflows/test.yml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Test
22

3+
34
on:
45
push:
56
branches:
@@ -10,7 +11,7 @@ on:
1011
workflow_dispatch:
1112

1213
jobs:
13-
build-test-x86:
14+
linux-test-x86:
1415
runs-on: ubuntu-latest
1516
container:
1617
image: ubuntu:22.04
@@ -42,35 +43,33 @@ jobs:
4243
cd /root/libcpp-http-client
4344
./build/test/test
4445
45-
build-test-aarch64:
46-
needs: build-test-x86
46+
linux-test-aarch64:
47+
needs: linux-test-x86
4748
runs-on: ubuntu-latest
48-
container:
49-
image: arm64v8/ubuntu:22.04
50-
5149
steps:
50+
- uses: docker/setup-qemu-action@v1
51+
with:
52+
platforms: all
5253
- uses: actions/checkout@v3
53-
- name: Install prerequisites
54-
run: |
55-
apt update
56-
apt install -y build-essential g++ make cmake pkg-config git wget curl zip unzip tar
57-
- name: Install vcpkg
54+
- name: Set up Docker Buildx
55+
uses: docker/setup-buildx-action@v1
56+
- name: Install prerequisites and build project using qemu
5857
run: |
59-
git clone https://github.com/microsoft/vcpkg.git /opt/vcpkg
60-
/opt/vcpkg/bootstrap-vcpkg.sh
61-
ln -s /opt/vcpkg/vcpkg /usr/local/bin/vcpkg
58+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
59+
docker buildx create --name mybuilder --use
60+
docker buildx build --platform linux/arm64 -o type=docker -t myimage .
61+
docker run myimage
6262
- name: Clone project repository
6363
run: |
6464
git clone https://github.com/lk-libs/libcpp-http-client.git /root/libcpp-http-client
6565
- name: Run cmake with vcpkg toolchain
6666
run: |
6767
cd /root/libcpp-http-client
6868
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake
69-
- name: Build the project
69+
- name: Build the project using Buildx
7070
run: |
71-
cd /root/libcpp-http-client
72-
cmake --build build --config Release
73-
- name: Run tests
71+
docker buildx build --platform linux/arm64 -o type=docker -t myproject .
72+
docker run myproject
73+
- name: Run tests in Docker
7474
run: |
75-
cd /root/libcpp-http-client
76-
./build/test/test
75+
docker run myproject /root/libcpp-http-client/build/test/test

0 commit comments

Comments
 (0)