| 1 | name: linux-loongarch64-cpu-gcc |
| 2 | on: |
| 3 | push: |
| 4 | branches: [master] |
| 5 | paths: |
| 6 | - '.github/workflows/linux-loongarch64-cpu-gcc.yml' |
| 7 | - 'toolchains/loongarch64-linux-gnu.toolchain.cmake' |
| 8 | - 'toolchains/loongarch64-unknown-linux-gnu.toolchain.cmake' |
| 9 | - 'CMakeLists.txt' |
| 10 | - 'cmake/**' |
| 11 | - 'src/*' |
| 12 | - 'src/layer/*' |
| 13 | - 'src/layer/loongarch/**' |
| 14 | - 'tests/**' |
| 15 | pull_request: |
| 16 | branches: [master] |
| 17 | paths: |
| 18 | - '.github/workflows/linux-loongarch64-cpu-gcc.yml' |
| 19 | - 'toolchains/loongarch64-linux-gnu.toolchain.cmake' |
| 20 | - 'toolchains/loongarch64-unknown-linux-gnu.toolchain.cmake' |
| 21 | - 'CMakeLists.txt' |
| 22 | - 'cmake/**' |
| 23 | - 'src/*' |
| 24 | - 'src/layer/*' |
| 25 | - 'src/layer/loongarch/**' |
| 26 | - 'tests/**' |
| 27 | concurrency: |
| 28 | group: linux-loongarch64-cpu-gcc-${{ github.ref }} |
| 29 | cancel-in-progress: true |
| 30 | permissions: |
| 31 | contents: read |
| 32 | |
| 33 | jobs: |
| 34 | linux-gcc-loongarch64: |
| 35 | runs-on: [self-hosted, linux, centos] |
| 36 | |
| 37 | steps: |
| 38 | - uses: actions/checkout@v4 |
| 39 | |
| 40 | # - name: cache-qemu |
| 41 | # id: cache-qemu |
| 42 | # uses: actions/cache@v3 |
| 43 | # with: |
| 44 | # path: qemu-install |
| 45 | # key: qemu-loongarch64-install-20230524 |
| 46 | # - name: checkout-qemu |
| 47 | # if: steps.cache-qemu.outputs.cache-hit != 'true' |
| 48 | # uses: actions/checkout@v4 |
| 49 | # with: |
| 50 | # repository: qemu/qemu |
| 51 | # path: qemu |
| 52 | # ref: 1c12355b31046a6b35a4f50c85c4f01afb1bd728 |
| 53 | # - name: qemu |
| 54 | # if: steps.cache-qemu.outputs.cache-hit != 'true' |
| 55 | # run: | |
| 56 | # cd qemu |
| 57 | # ./configure --prefix=$GITHUB_WORKSPACE/qemu-install --target-list=loongarch64-linux-user --disable-system |
| 58 | # make -j2 |
| 59 | # make install |
| 60 | |
| 61 | # - name: loongarch64-toolchain |
| 62 | # run: | |
| 63 | # wget https://github.com/sunhaiyong1978/CLFS-for-LoongArch/releases/download/8.0/loongarch64-clfs-8.0-cross-tools-gcc-full.tar.xz |
| 64 | # tar -xf loongarch64-clfs-8.0-cross-tools-gcc-full.tar.xz |
| 65 | |
| 66 | - name: build |
| 67 | run: | |
| 68 | export LOONGARCH64_ROOT_PATH=/data/action/osd/cross-tools |
| 69 | mkdir build && cd build |
| 70 | cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/loongarch64-unknown-linux-gnu.toolchain.cmake -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON .. |
| 71 | cmake --build . -j 4 |
| 72 | |
| 73 | - name: test |
| 74 | run: | |
| 75 | export PATH=/data/action/osd/qemu-loongson/qemu-install/bin:$PATH |
| 76 | cd build |
| 77 | TESTS_EXECUTABLE_LOADER=qemu-loongarch64 TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/data/action/osd/cross-tools/target" ctest --output-on-failure -j 4 |