Skip to content

Commit 1569a43

Browse files
committed
GitHub Actions: Add cross compile tests
Add cross compile tests without running checks. Currently only mips64el, riscv64, mipsel, alpha is wired up. Just help us make sure those less popular CPUs are not messed up by changes. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
1 parent aaaecdb commit 1569a43

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/dynamic_arch.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,3 +257,53 @@ jobs:
257257
- name: Run tests
258258
timeout-minutes: 60
259259
run: cd build && ctest
260+
261+
cross_build:
262+
runs-on: ubuntu-22.04
263+
264+
strategy:
265+
fail-fast: false
266+
matrix:
267+
include:
268+
- target: mips64el
269+
triple: mips64el-linux-gnuabi64
270+
opts: DYNAMIC_ARCH=1
271+
- target: riscv64
272+
triple: riscv64-linux-gnu
273+
opts: TARGET=RISCV64_GENERIC
274+
- target: mipsel
275+
triple: mipsel-linux-gnu
276+
opts: TARGET=MIPS1004K
277+
- target: alpha
278+
triple: alpha-linux-gnu
279+
opts: TARGET=EV4
280+
281+
steps:
282+
- name: Checkout repository
283+
uses: actions/checkout@v3
284+
285+
- name: Install Dependencies
286+
run: |
287+
sudo apt-get install -y ccache gcc-${{ matrix.triple }} gfortran-${{ matrix.triple }} libgomp1-${{ matrix.target }}-cross
288+
289+
- name: Compilation cache
290+
uses: actions/cache@v3
291+
with:
292+
path: ~/.ccache
293+
key: ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }}-${{ github.sha }}
294+
restore-keys: |
295+
ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }}
296+
ccache-${{ runner.os }}-${{ matrix.target }}
297+
298+
- name: Configure ccache
299+
run: |
300+
# Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota (5 GB).
301+
test -d ~/.ccache || mkdir -p ~/.ccache
302+
echo "max_size = 300M" > ~/.ccache/ccache.conf
303+
echo "compression = true" >> ~/.ccache/ccache.conf
304+
ccache -s
305+
306+
307+
- name: Build OpenBLAS
308+
run: |
309+
make -j$(nproc) HOSTCC="ccache gcc" CC="ccache ${{ matrix.triple }}-gcc" FC="ccache ${{ matrix.triple }}-gfortran" ARCH=${{ matrix.target }} ${{ matrix.opts }}

0 commit comments

Comments
 (0)