summaryrefslogtreecommitdiff
path: root/.github/workflows/configure.yml
blob: c34a82c983d66acfb592a1c1479a9b58142994b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Configure
on: [push, pull_request]
jobs:
  ci-configure:
    name: ${{ matrix.name }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - name: Ubuntu GCC
            os: ubuntu-latest
            compiler: gcc
            configure-args: --warn

          # Test out of source builds
          - name: Ubuntu GCC OSB
            os: ubuntu-latest
            compiler: gcc
            configure-args: --warn
            build-dir: ../build
            src-dir: ../zlib

          - name: Ubuntu GCC ARM SF
            os: ubuntu-latest
            compiler: arm-linux-gnueabi-gcc
            configure-args: --warn
            chost: arm-linux-gnueabi
            packages: qemu qemu-user gcc-arm-linux-gnueabi libc-dev-armel-cross
            qemu-run: qemu-arm -L /usr/arm-linux-gnueabi

          - name: Ubuntu GCC ARM HF
            os: ubuntu-latest
            compiler: arm-linux-gnueabihf-gcc
            configure-args: --warn
            chost: arm-linux-gnueabihf
            packages: qemu qemu-user gcc-arm-linux-gnueabihf libc-dev-armhf-cross
            qemu-run: qemu-arm -L /usr/arm-linux-gnueabihf

          - name: Ubuntu GCC AARCH64
            os: ubuntu-latest
            compiler: aarch64-linux-gnu-gcc
            configure-args: --warn
            chost: aarch64-linux-gnu
            packages: qemu qemu-user gcc-aarch64-linux-gnu libc-dev-arm64-cross
            qemu-run: qemu-aarch64 -L /usr/aarch64-linux-gnu

          - name: macOS GCC
            os: macos-latest
            compiler: gcc-9
            configure-args: --warn

    steps:
    - name: Checkout repository
      uses: actions/checkout@v3

    - name: Install packages (Ubuntu)
      if: runner.os == 'Linux' && matrix.packages
      run: |
        sudo apt-get update
        sudo apt-get install -y ${{ matrix.packages }}

    - name: Generate project files
      run: |
        [ -d ${{ matrix.build-dir || '.' }} ] || mkdir ${{ matrix.build-dir || '.' }}
        cd ${{ matrix.build-dir || '.' }}
        ${{ matrix.src-dir || '.' }}/configure ${{ matrix.configure-args }}
      env:
        CC: ${{ matrix.compiler }}
        CHOST: ${{ matrix.chost }}

    - name: Compile source code
      run: make -j2
      working-directory: ${{ matrix.build-dir }}

    - name: Run test cases
      run: |
        make test
        make cover
      working-directory: ${{ matrix.build-dir }}

    - name: Upload build errors
      uses: actions/upload-artifact@v3
      if: failure()
      with:
        name: ${{ matrix.name }} (configure)
        path: |
          ${{ matrix.build-dir || '.' }}/configure.log
        retention-days: 7