summaryrefslogtreecommitdiffstats
path: root/.github/workflows/cross-compiles.yml
blob: 6b4505c5db2aaa8956ededb9dfd719ac55716e09 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Cross Compile

on: [pull_request, push]

jobs:
  cross-compilation:
    strategy:
      fail-fast: false
      matrix:
        # The platform matrix specifies:
        #   arch: the architecture to build for, this defines the tool-chain
        #         prefix {arch}- and the Debian compiler package gcc-{arch}
        #         name.
        #   libs: the Debian package for the necessary link/runtime libraries.
        #   target: the OpenSSL configuration target to use, this is passed
        #           directly to the config command line.
        #   tests: omit this to run all the tests using QEMU, set it to "none"
        #          to never run the tests, otherwise it's value is passed to
        #          the "make test" command to allow selectiving disabling of
        #          tests.
        platform: [
          {
            arch: aarch64-linux-gnu,
            libs: libc6-dev-arm64-cross,
            target: linux-aarch64
          }, {
            arch: alpha-linux-gnu,
            libs: libc6.1-dev-alpha-cross,
            target: linux-alpha-gcc
          }, {
            arch: arm-linux-gnueabi,
            libs: libc6-dev-armel-cross,
            target: linux-armv4,
            tests: -test_includes -test_store -test_x509_store
          }, {
            arch: arm-linux-gnueabihf,
            libs: libc6-dev-armhf-cross,
            target: linux-armv4,
            tests: -test_includes -test_store -test_x509_store
          }, {
            arch: hppa-linux-gnu,
            libs: libc6-dev-hppa-cross,
            target: linux-generic32,
            tests: none #-test_includes -test_store -test_x509_store
          }, {
            arch: m68k-linux-gnu,
            libs: libc6-dev-m68k-cross,
            target: linux-latomic no-asm,
            tests: none #-test_includes -test_store -test_x509_store -test_includes
          }, {
            arch: mips-linux-gnu,
            libs: libc6-dev-mips-cross,
            target: linux-mips32,
            tests: none
          }, {
            arch: mips64-linux-gnuabi64,
            libs: libc6-dev-mips64-cross,
            target: linux64-mips64,
            tests: none
          }, {
            arch: mipsel-linux-gnu,
            libs: libc6-dev-mipsel-cross,
            target: linux-mips32,
            tests: -test_includes -test_store -test_x509_store
          }, {
            arch: powerpc64le-linux-gnu,
            libs: libc6-dev-ppc64el-cross,
            target: linux-ppc64le
          }, {
            arch: riscv64-linux-gnu,
            libs: libc6-dev-riscv64-cross,
            target: linux64-riscv64
          }, {
            arch: s390x-linux-gnu,
            libs: libc6-dev-s390x-cross,
            target: linux64-s390x
          }, {
            arch: sh4-linux-gnu,
            libs: libc6-dev-sh4-cross,
            target: linux-latomic,
            tests: -test_includes -test_store -test_x509_store -test_async
          }, {
            arch: sparc64-linux-gnu,
            libs: libc6-dev-sparc64-cross,
            target: linux64-sparcv9,
            tests: none
          }
        ]
    runs-on: ubuntu-latest
    steps:
    - name: install packages
      run: |
        sudo apt-get update
        sudo apt-get -yq --force-yes install \
            gcc-${{ matrix.platform.arch }} \
            ${{ matrix.platform.libs }}
    - uses: actions/checkout@v2

    - name: config
      run: |
        ./config --banner=Configured --strict-warnings enable-fips \
                 --cross-compile-prefix=${{ matrix.platform.arch }}- \
                 ${{ matrix.platform.target }}
    - name: config dump
      run: ./configdata.pm --dump

    - name: make
      run: make -s -j4

    - name: install qemu
      if: github.event_name == 'push' && matrix.platform.tests != 'none'
      run: sudo apt-get -yq --force-yes install qemu-user

    - name: make all tests
      if: github.event_name == 'push' && matrix.platform.tests == ''
      run: |
        make test HARNESS_JOBS=${HARNESS_JOBS:-4} \
                  QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }}
    - name: make some tests
      if: github.event_name == 'push' && matrix.platform.tests != 'none' && matrix.platform.tests != ''
      run: |
        make test HARNESS_JOBS=${HARNESS_JOBS:-4} \
                  TESTS="${{ matrix.platform.tests }}" \
                  QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }}