xref: /libuv/.github/workflows/CI-unix.yml (revision 4e416266)
1name: CI-unix
2
3on:
4  pull_request:
5    paths:
6      - '**'
7      - '!docs/**'
8      - '!src/win/**'
9      - '!.**'
10      - '.github/workflows/CI-unix.yml'
11  push:
12    branches:
13      - v[0-9].*
14      - master
15
16jobs:
17  build-linux:
18    runs-on: ubuntu-latest
19    steps:
20      - uses: actions/checkout@v3
21      - name: configure
22        run: |
23          ./autogen.sh
24          mkdir build
25          (cd build && ../configure)
26      - name: distcheck
27        run: |
28          make -C build distcheck
29
30  build-android:
31    runs-on: ubuntu-latest
32    container: reactnativecommunity/react-native-android:2020-5-20
33    steps:
34      - uses: actions/checkout@v2
35      - name: Envinfo
36        run: npx envinfo
37      - name: Configure android arm64
38        # see build options you can use in https://developer.android.com/ndk/guides/cmake
39        run: |
40          mkdir build
41          cd build
42          $ANDROID_HOME/cmake/3.10.2.4988404/bin/cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROID_HOME/ndk/20.0.5594570/build/cmake/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DANDROID_ABI="arm64-v8a" -DANDROID_PLATFORM=android-24 ..
43      - name: Build android arm64
44        run: |
45          $ANDROID_HOME/cmake/3.10.2.4988404/bin/cmake --build build
46          ls -lh build
47
48  build-macos:
49    runs-on: macos-11
50    steps:
51      - uses: actions/checkout@v2
52      - name: Envinfo
53        run: npx envinfo
54      - name: Setup
55        run: |
56          brew install ninja automake libtool
57      - name: Configure
58        run: |
59          mkdir build
60          cd build
61          cmake .. -DBUILD_TESTING=ON -G Ninja
62      - name: Build
63        run: |
64          cmake --build build
65          ls -lh
66      - name: platform_output
67        run: |
68          ./build/uv_run_tests platform_output
69      - name: platform_output_a
70        run: |
71          ./build/uv_run_tests_a platform_output
72      - name: Test
73        run: |
74          cd build && ctest -V
75      - name: Autotools configure
76        if: always()
77        run: |
78          ./autogen.sh
79          mkdir build-auto
80          (cd build-auto && ../configure)
81          make -C build-auto -j4
82
83  build-ios:
84    runs-on: macos-11
85    steps:
86      - uses: actions/checkout@v2
87      - name: Configure
88        run: |
89          mkdir build-ios
90          cd build-ios
91          cmake .. -GXcode -DCMAKE_SYSTEM_NAME:STRING=iOS -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED:BOOL=NO -DCMAKE_CONFIGURATION_TYPES:STRING=Release
92      - name: Build
93        run: |
94          cmake --build build-ios
95          ls -lh build-ios
96
97  build-cross-qemu:
98    runs-on: ubuntu-latest
99    name: build-cross-qemu-${{ matrix.config.target }}
100
101    strategy:
102      fail-fast: false
103      matrix:
104        config:
105          - {target: arm,     toolchain: gcc-arm-linux-gnueabi,     cc: arm-linux-gnueabi-gcc,      qemu: qemu-arm-static     }
106          - {target: armhf,   toolchain: gcc-arm-linux-gnueabihf,   cc: arm-linux-gnueabihf-gcc,    qemu: qemu-arm-static     }
107          - {target: aarch64, toolchain: gcc-aarch64-linux-gnu,     cc: aarch64-linux-gnu-gcc,      qemu: qemu-aarch64-static }
108          - {target: riscv64, toolchain: gcc-riscv64-linux-gnu,     cc: riscv64-linux-gnu-gcc,      qemu: qemu-riscv64-static }
109          - {target: ppc,     toolchain: gcc-powerpc-linux-gnu,     cc: powerpc-linux-gnu-gcc,      qemu: qemu-ppc-static     }
110          - {target: ppc64,   toolchain: gcc-powerpc64-linux-gnu,   cc: powerpc64-linux-gnu-gcc,    qemu: qemu-ppc64-static   }
111          - {target: ppc64le, toolchain: gcc-powerpc64le-linux-gnu, cc: powerpc64le-linux-gnu-gcc,  qemu: qemu-ppc64le-static }
112          - {target: s390x,   toolchain: gcc-s390x-linux-gnu,       cc: s390x-linux-gnu-gcc,        qemu: qemu-s390x-static   }
113          - {target: mips,    toolchain: gcc-mips-linux-gnu,          cc: mips-linux-gnu-gcc,         qemu: qemu-mips-static     }
114          - {target: mips64,  toolchain: gcc-mips64-linux-gnuabi64,   cc: mips64-linux-gnuabi64-gcc,  qemu: qemu-mips64-static   }
115          - {target: mipsel,  toolchain: gcc-mipsel-linux-gnu,        cc: mipsel-linux-gnu-gcc,       qemu: qemu-mipsel-static   }
116          - {target: mips64el,toolchain: gcc-mips64el-linux-gnuabi64, cc: mips64el-linux-gnuabi64-gcc,qemu: qemu-mips64el-static }
117          - {target: arm (u64 slots),     toolchain: gcc-arm-linux-gnueabi,     cc: arm-linux-gnueabi-gcc,      qemu: qemu-arm-static}
118          - {target: aarch64 (u64 slots), toolchain: gcc-aarch64-linux-gnu,     cc: aarch64-linux-gnu-gcc,      qemu: qemu-aarch64-static}
119          - {target: ppc (u64 slots),     toolchain: gcc-powerpc-linux-gnu,     cc: powerpc-linux-gnu-gcc,      qemu: qemu-ppc-static}
120          - {target: ppc64 (u64 slots),   toolchain: gcc-powerpc64-linux-gnu,   cc: powerpc64-linux-gnu-gcc,    qemu: qemu-ppc64-static}
121
122    steps:
123      - uses: actions/checkout@v2
124      - name: Install QEMU
125        # this ensure install latest qemu on ubuntu, apt get version is old
126        env:
127          QEMU_SRC: "http://archive.ubuntu.com/ubuntu/pool/universe/q/qemu"
128          QEMU_VER: "qemu-user-static_7\\.2+dfsg-.*_amd64.deb$"
129        run: |
130          DEB=`curl -s $QEMU_SRC/ | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 | grep $QEMU_VER | tail -1`
131          wget $QEMU_SRC/$DEB
132          sudo dpkg -i $DEB
133      - name: Install ${{ matrix.config.toolchain }}
134        run: |
135          sudo apt update
136          sudo apt install ${{ matrix.config.toolchain }} -y
137      - name: Configure with ${{ matrix.config.cc }}
138        run: |
139          mkdir build
140          cd build
141          cmake .. -DBUILD_TESTING=ON -DQEMU=ON -DCMAKE_C_COMPILER=${{ matrix.config.cc }}
142      - name: Build
143        run: |
144          cmake --build build
145          ls -lh build
146      - name: Test
147        run: |
148          ${{ matrix.config.qemu }} build/uv_run_tests_a
149