]> git.ipfire.org Git - thirdparty/openssl.git/blob - .github/workflows/cross-compiles.yml
Revert "CI: cross-compile: riscv: Add RV64 machine with Zb* and Zk*"
[thirdparty/openssl.git] / .github / workflows / cross-compiles.yml
1 # Copyright 2021-2022 The OpenSSL Project Authors. All Rights Reserved.
2 #
3 # Licensed under the Apache License 2.0 (the "License"). You may not use
4 # this file except in compliance with the License. You can obtain a copy
5 # in the file LICENSE in the source distribution or at
6 # https://www.openssl.org/source/license.html
7
8 name: Cross Compile
9
10 on: [pull_request, push]
11
12 permissions:
13 contents: read
14
15 jobs:
16 cross-compilation:
17 strategy:
18 fail-fast: false
19 matrix:
20 # The platform matrix specifies:
21 # arch: the architecture to build for, this defines the tool-chain
22 # prefix {arch}- and the Debian compiler package gcc-{arch}
23 # name.
24 # libs: the Debian package for the necessary link/runtime libraries.
25 # target: the OpenSSL configuration target to use, this is passed
26 # directly to the config command line.
27 # fips: set to "no" to disable building FIPS, leave unset to
28 # build the FIPS provider.
29 # tests: omit this to run all the tests using QEMU, set it to "none"
30 # to never run the tests, otherwise its value is passed to
31 # the "make test" command to allow selective disabling of
32 # tests.
33 # qemucpu: optional; string that describes CPU properties.
34 # The string will be used to set the QEMU_CPU variable.
35 # opensslcapsname: optional; string that describes the postfix of the
36 # OpenSSL environment variable that defines CPU
37 # capabilities. E.g. "foo" will result in an
38 # environment variable with the name OPENSSL_foo.
39 # opensslcaps: optional; if opensslcapsname (see above) is set, then
40 # this string will be used as content for the OpenSSL
41 # capabilities variable.
42 platform: [
43 {
44 arch: aarch64-linux-gnu,
45 libs: libc6-dev-arm64-cross,
46 target: linux-aarch64
47 }, {
48 arch: alpha-linux-gnu,
49 libs: libc6.1-dev-alpha-cross,
50 target: linux-alpha-gcc
51 }, {
52 arch: arm-linux-gnueabi,
53 libs: libc6-dev-armel-cross,
54 target: linux-armv4,
55 tests: -test_includes -test_store -test_x509_store
56 }, {
57 arch: arm-linux-gnueabihf,
58 libs: libc6-dev-armhf-cross,
59 target: linux-armv4,
60 tests: -test_includes -test_store -test_x509_store
61 }, {
62 arch: hppa-linux-gnu,
63 libs: libc6-dev-hppa-cross,
64 target: -static linux-generic32,
65 fips: no,
66 tests: -test_includes -test_store -test_x509_store
67 }, {
68 arch: m68k-linux-gnu,
69 libs: libc6-dev-m68k-cross,
70 target: -static -m68040 linux-latomic -Wno-stringop-overflow,
71 fips: no,
72 tests: -test_includes -test_store -test_x509_store
73 }, {
74 arch: mips-linux-gnu,
75 libs: libc6-dev-mips-cross,
76 target: -static linux-mips32,
77 fips: no,
78 tests: -test_includes -test_store -test_x509_store
79 }, {
80 arch: mips64-linux-gnuabi64,
81 libs: libc6-dev-mips64-cross,
82 target: -static linux64-mips64,
83 fips: no
84 }, {
85 arch: mipsel-linux-gnu,
86 libs: libc6-dev-mipsel-cross,
87 target: linux-mips32,
88 tests: -test_includes -test_store -test_x509_store
89 }, {
90 arch: powerpc64le-linux-gnu,
91 libs: libc6-dev-ppc64el-cross,
92 # The default compiler for this platform on Ubuntu 20.04 seems
93 # buggy and causes test failures. Dropping the optimisation level
94 # resolves it.
95 target: -O2 linux-ppc64le
96 }, {
97 arch: riscv64-linux-gnu,
98 libs: libc6-dev-riscv64-cross,
99 target: linux64-riscv64
100 }, {
101 arch: s390x-linux-gnu,
102 libs: libc6-dev-s390x-cross,
103 target: linux64-s390x -Wno-stringop-overflow
104 }, {
105 arch: sh4-linux-gnu,
106 libs: libc6-dev-sh4-cross,
107 target: no-async linux-latomic,
108 tests: -test_includes -test_store -test_x509_store
109 },
110
111 # These build with shared libraries but they crash when run
112 # They mirror static builds above in order to cover more of the
113 # code base.
114 {
115 arch: hppa-linux-gnu,
116 libs: libc6-dev-hppa-cross,
117 target: linux-generic32,
118 tests: none
119 }, {
120 arch: m68k-linux-gnu,
121 libs: libc6-dev-m68k-cross,
122 target: -mcfv4e linux-latomic -Wno-stringop-overflow,
123 tests: none
124 }, {
125 arch: mips-linux-gnu,
126 libs: libc6-dev-mips-cross,
127 target: linux-mips32,
128 tests: none
129 }, {
130 arch: mips64-linux-gnuabi64,
131 libs: libc6-dev-mips64-cross,
132 target: linux64-mips64,
133 tests: none
134 },
135
136 # This build doesn't execute either with or without shared libraries.
137 {
138 arch: sparc64-linux-gnu,
139 libs: libc6-dev-sparc64-cross,
140 target: linux64-sparcv9,
141 tests: none
142 }
143 ]
144 runs-on: ubuntu-latest
145 steps:
146 - name: install packages
147 run: |
148 sudo apt-get update
149 sudo apt-get -yq --force-yes install \
150 gcc-${{ matrix.platform.arch }} \
151 ${{ matrix.platform.libs }}
152 - uses: actions/checkout@v3
153
154 - name: config with FIPS
155 if: matrix.platform.fips != 'no'
156 run: |
157 ./config --banner=Configured --strict-warnings enable-fips \
158 --cross-compile-prefix=${{ matrix.platform.arch }}- \
159 ${{ matrix.platform.target }}
160 - name: config without FIPS
161 if: matrix.platform.fips == 'no'
162 run: |
163 ./config --banner=Configured --strict-warnings \
164 --cross-compile-prefix=${{ matrix.platform.arch }}- \
165 ${{ matrix.platform.target }}
166 - name: config dump
167 run: ./configdata.pm --dump
168
169 - name: make
170 run: make -s -j4
171
172 - name: install qemu
173 if: github.event_name == 'push' && matrix.platform.tests != 'none'
174 run: sudo apt-get -yq --force-yes install qemu-user
175
176 - name: Set QEMU environment
177 if: github.event_name == 'push' && matrix.platform.qemucpu != ''
178 run: echo "QEMU_CPU=${{ matrix.platform.qemucpu }}" >> $GITHUB_ENV
179
180 - name: Set OpenSSL caps environment
181 if: github.event_name == 'push' && matrix.platform.opensslcapsname != ''
182 run: echo "OPENSSL_${{ matrix.platform.opensslcapsname }}=\
183 ${{ matrix.platform.opensslcaps }}" >> $GITHUB_ENV
184
185 - name: make all tests
186 if: github.event_name == 'push' && matrix.platform.tests == ''
187 run: |
188 make test HARNESS_JOBS=${HARNESS_JOBS:-4} \
189 TESTS="-test_afalg" \
190 QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }}
191 - name: make some tests
192 if: github.event_name == 'push' && matrix.platform.tests != 'none' && matrix.platform.tests != ''
193 run: |
194 make test HARNESS_JOBS=${HARNESS_JOBS:-4} \
195 TESTS="${{ matrix.platform.tests }} -test_afalg" \
196 QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }}