diff --git a/.github/workflows/dynamic_arch.yml b/.github/workflows/dynamic_arch.yml index 153c63045..c34b0c462 100644 --- a/.github/workflows/dynamic_arch.yml +++ b/.github/workflows/dynamic_arch.yml @@ -257,3 +257,53 @@ jobs: - name: Run tests timeout-minutes: 60 run: cd build && ctest + + cross_build: + runs-on: ubuntu-22.04 + + strategy: + fail-fast: false + matrix: + include: + - target: mips64el + triple: mips64el-linux-gnuabi64 + opts: DYNAMIC_ARCH=1 + - target: riscv64 + triple: riscv64-linux-gnu + opts: TARGET=RISCV64_GENERIC + - target: mipsel + triple: mipsel-linux-gnu + opts: TARGET=MIPS1004K + - target: alpha + triple: alpha-linux-gnu + opts: TARGET=EV4 + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Install Dependencies + run: | + sudo apt-get install -y ccache gcc-${{ matrix.triple }} gfortran-${{ matrix.triple }} libgomp1-${{ matrix.target }}-cross + + - name: Compilation cache + uses: actions/cache@v3 + with: + path: ~/.ccache + key: ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }}-${{ github.sha }} + restore-keys: | + ccache-${{ runner.os }}-${{ matrix.target }}-${{ github.ref }} + ccache-${{ runner.os }}-${{ matrix.target }} + + - name: Configure ccache + run: | + # Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota (5 GB). + test -d ~/.ccache || mkdir -p ~/.ccache + echo "max_size = 300M" > ~/.ccache/ccache.conf + echo "compression = true" >> ~/.ccache/ccache.conf + ccache -s + + + - name: Build OpenBLAS + run: | + make -j$(nproc) HOSTCC="ccache gcc" CC="ccache ${{ matrix.triple }}-gcc" FC="ccache ${{ matrix.triple }}-gfortran" ARCH=${{ matrix.target }} ${{ matrix.opts }}