|
| 1 | +name: native and cross |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + runs-on: ubuntu-24.04 |
| 8 | + strategy: |
| 9 | + fail-fast: false |
| 10 | + matrix: |
| 11 | + release: |
| 12 | + - "ubuntu:20.04" |
| 13 | + - "ubuntu:22.04" |
| 14 | + - "ubuntu:24.04" |
| 15 | + - "ubuntu:rolling" |
| 16 | + - "debian:oldstable-slim" |
| 17 | + - "debian:stable-slim" |
| 18 | + - "debian:testing-slim" |
| 19 | + - "debian:unstable-slim" |
| 20 | + - "debian:experimental" |
| 21 | + |
| 22 | + steps: |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - name: Prepare ${{ matrix.release }} container |
| 26 | + env: |
| 27 | + release: ${{ matrix.release == 'debian:experimental' && '-t experimental' || '' }} |
| 28 | + run: | |
| 29 | + podman version |
| 30 | + podman run --name stable -di --userns=keep-id:uid=1000,gid=1000 -v "$PWD":/home -w /home ${{ matrix.release }} bash |
| 31 | + podman exec -i stable uname -a |
| 32 | + podman exec -i stable id |
| 33 | + podman exec -i -u root stable apt update |
| 34 | + podman exec -e DEBIAN_FRONTEND='noninteractive' -i -u root stable apt install -o APT::Install-Suggests=false -qy ${release} \ |
| 35 | + automake \ |
| 36 | + clang \ |
| 37 | + gcc \ |
| 38 | + gcc-aarch64-linux-gnu \ |
| 39 | + gcc-arm-linux-gnueabihf \ |
| 40 | + gcc-mips-linux-gnu \ |
| 41 | + intltool \ |
| 42 | + libtool \ |
| 43 | + make \ |
| 44 | + sed |
| 45 | +
|
| 46 | + - name: autogen |
| 47 | + run: | |
| 48 | + podman exec -i stable ./autogen.sh |
| 49 | + |
| 50 | + - name: Configure & Build with gcc |
| 51 | + env: |
| 52 | + CC: gcc |
| 53 | + run: | |
| 54 | + podman exec -i stable bash -c "mkdir build-${CC} && cd build-${CC} && ../configure" |
| 55 | + podman exec -i stable make -C build-${CC} |
| 56 | +
|
| 57 | + - name: Configure & Build with clang |
| 58 | + env: |
| 59 | + CC: clang |
| 60 | + run: | |
| 61 | + podman exec -i stable bash -c "mkdir build-${CC} && cd build-${CC} && ../configure" |
| 62 | + podman exec -i stable make -C build-${CC} |
| 63 | +
|
| 64 | + - name: Configure & Build with arm-linux-gnueabihf-gcc |
| 65 | + env: |
| 66 | + host: arm-linux-gnueabihf |
| 67 | + run: | |
| 68 | + podman exec -i stable bash -c "mkdir build-${host} && cd build-${host} && ../configure --host=${host}" |
| 69 | + podman exec -i stable make -C build-${host} |
| 70 | +
|
| 71 | + - name: Configure & Build with arm-linux-gnueabihf-clang |
| 72 | + if: |
| 73 | + ${{ matrix.release != 'ubuntu:20.04' && matrix.release != 'debian:oldstable-slim' }} |
| 74 | + env: |
| 75 | + host: arm-linux-gnueabihf |
| 76 | + run: | |
| 77 | + podman exec -i stable bash -c "mkdir build-${host}-clang && cd build-${host}-clang && ../configure --host=${host} CC=\"clang --target=${host}\"" |
| 78 | + podman exec -i stable make -C build-${host}-clang |
| 79 | +
|
| 80 | + - name: Configure & Build with aarch64-linux-gnu |
| 81 | + env: |
| 82 | + host: aarch64-linux-gnu |
| 83 | + run: | |
| 84 | + podman exec -i stable bash -c "mkdir build-${host} && cd build-${host} && ../configure --host=${host}" |
| 85 | + podman exec -i stable make -C build-${host} |
| 86 | +
|
| 87 | + - name: Configure & Build with aarch64-linux-gnu-clang |
| 88 | + if: |
| 89 | + ${{ matrix.release != 'ubuntu:20.04' && matrix.release != 'debian:oldstable-slim' }} |
| 90 | + env: |
| 91 | + host: aarch64-linux-gnu |
| 92 | + run: | |
| 93 | + podman exec -i stable bash -c "mkdir build-${host}-clang && cd build-${host}-clang && ../configure --host=${host} CC=\"clang --target=${host}\"" |
| 94 | + podman exec -i stable make -C build-${host}-clang |
| 95 | +
|
| 96 | + - name: Configure & Build with mips-linux-gnu |
| 97 | + env: |
| 98 | + host: mips-linux-gnu |
| 99 | + run: | |
| 100 | + podman exec -i stable bash -c "mkdir build-${host} && cd build-${host} && ../configure --host=${host}" |
| 101 | + podman exec -i stable make -C build-${host} |
| 102 | +
|
| 103 | + - name: Show logs |
| 104 | + if: ${{ failure() }} |
| 105 | + run: | |
| 106 | + for log in build-*/config.log; do \ |
| 107 | + if [ -e ${log} ]; then \ |
| 108 | + echo "---------------- ${log} ----------------"; \ |
| 109 | + cat ${log}; \ |
| 110 | + fi; \ |
| 111 | + done |
0 commit comments