@@ -2,7 +2,6 @@ name: build targets
2
2
on : [push,pull_request]
3
3
jobs :
4
4
build :
5
- if : github.repository == 'QW-Group/mvdsv'
6
5
runs-on : ${{ matrix.base-image }}
7
6
strategy :
8
7
fail-fast : false
@@ -17,19 +16,19 @@ jobs:
17
16
ext : " "
18
17
- target : linux-i686
19
18
os : linux
20
- arch : i686
19
+ arch : i386
21
20
base-image : ubuntu-latest
22
21
build-image : i386/debian:stable
23
22
ext : " "
24
23
- target : linux-armhf
25
24
os : linux
26
- arch : armhf
25
+ arch : arm/v7
27
26
base-image : ubuntu-latest
28
27
build-image : arm32v7/debian:stable
29
28
ext : " "
30
29
- target : linux-aarch64
31
30
os : linux
32
- arch : aarch64
31
+ arch : arm64
33
32
base-image : ubuntu-latest
34
33
build-image : arm64v8/debian:stable
35
34
ext : " "
@@ -48,24 +47,26 @@ jobs:
48
47
uses : actions/checkout@v4
49
48
with :
50
49
submodules : true
50
+
51
+ - name : Set up QEMU
52
+ uses : docker/setup-qemu-action@v3
53
+ if : matrix.os == 'linux'
54
+
51
55
- name : Prepare Build Environemnt
52
56
shell : bash
53
- run : |
54
- if ${{ matrix.os == 'linux' }}; then
55
- sudo apt-get update
56
- sudo apt-get -y install qemu-system-arm qemu-user-static
57
- else
58
- sudo apt-get update
59
- sudo apt-get -y install build-essential cmake gcc-i686-linux-gnu
60
- sudo apt-get -y install gcc-arm-linux-gnueabihf libc6-dev-armhf-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross
61
- sudo apt-get -y install gcc-mingw-w64-x86-64 gcc-mingw-w64-i686
62
- fi
57
+ run : sudo apt-get update -qq && sudo apt-get -qq --no-install-recommends install build-essential cmake gcc-mingw-w64-x86-64 gcc-mingw-w64-i686
58
+ if : matrix.os == 'windows'
59
+
63
60
- name : Build
64
- shell : bash
65
61
run : |
66
62
if ${{ matrix.os == 'linux' }}; then
67
- docker pull ${{ matrix.build-image }}
68
- docker run --net=host --rm --device /dev/fuse -v $PWD:/mvdsv ${{ matrix.build-image }} bash -c -e 'export ARCH=$(dpkg --print-architecture);export DEBIAN_FRONTEND=noninteractive;mkdir -p /etc/apt/apt.conf.d;echo "APT::Install-Recommends "0"; APT::AutoRemove::RecommendsImportant "false";" >> /etc/apt/apt.conf.d/01lean && apt-get -qqy update && apt-get -qqy dist-upgrade && apt-get -qqy install cmake build-essential libcurl4-openssl-dev && ln -sf "$(which make)" /usr/bin/gmake && cd /mvdsv && ./build_cmake.sh ${{ matrix.target }} && chown -R '$(id -u ${USER})':'$(id -g ${USER})' /mvdsv/build/${{ matrix.target }}||exit 3'
63
+ docker run --platform linux/${{ matrix.arch }} --net=host --rm --device /dev/fuse -v $PWD:/mvdsv -w /mvdsv ${{ matrix.build-image }} bash -c -e '
64
+ set -e
65
+ apt-get -qq update
66
+ apt-get -qq --no-install-recommends install cmake build-essential libcurl4-openssl-dev ninja-build
67
+ ./build_cmake.sh ${{ matrix.target }}
68
+ chown -R '$(id -u ${USER})':'$(id -g ${USER})' build/${{ matrix.target }} || exit 3
69
+ '
69
70
else
70
71
./build_cmake.sh ${{ matrix.target }}
71
72
fi
0 commit comments