feat add test
Some checks failed
linux-mips64-gcc / linux-gcc-mips64el (push) Failing after 1m47s
linux-x64-gcc / linux-gcc (Debug) (push) Failing after 1m2s
linux-x64-gcc / linux-gcc (Release) (push) Failing after 1m46s

This commit is contained in:
tqcq 2024-03-31 02:15:00 +08:00
parent 9fe332c89a
commit 6431a560a9
2 changed files with 13 additions and 6 deletions

View File

@ -46,19 +46,19 @@ jobs:
git init git init
git remote add origin https://gitlab.com/qemu-project/qemu.git git remote add origin https://gitlab.com/qemu-project/qemu.git
git fetch --depth=1 origin f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 git fetch --depth=1 origin f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
git checkout f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65 git checkout f5643914a9e8f79c606a76e6a9d7ea82a3fc3e65
- name: install-qemu-build-deps - name: install-qemu-build-deps
if: steps.cache-qemu.outputs.cache-hit != 'true' if: steps.cache-qemu.outputs.cache-hit != 'true'
run: | run: |
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install -y autoconf automake autotools-dev ninja-build sudo apt-get install -y autoconf automake autotools-dev ninja-build
- name: qemu - name: qemu
if: steps.cache-qemu.outputs.cache-hit != 'true' if: steps.cache-qemu.outputs.cache-hit != 'true'
run: | run: |
cd $GITHUB_WORKSPACE/qemu cd $GITHUB_WORKSPACE/qemu
./configure --target-list=mips64el-linux-user --prefix=$GITHUB_WORKSPACE/qemu-install ./configure --target-list=mips64el-linux-user --prefix=$GITHUB_WORKSPACE/qemu-install
make -j `nproc` make -j `nproc`
make install make install
- name: set-qemu-cache - name: set-qemu-cache
uses: actions/cache/save@v3 uses: actions/cache/save@v3
if: steps.cache-qemu.outputs.cache-hit != 'true' if: steps.cache-qemu.outputs.cache-hit != 'true'
@ -68,11 +68,11 @@ jobs:
- name: mips64el-gnuabi64-toolchain - name: mips64el-gnuabi64-toolchain
run: | run: |
sudo apt-get update -y sudo apt-get update -y
sudo apt-get install -y cmake make g++-mips64el-linux-gnuabi64 sudo apt-get install -y cmake make g++-mips64el-linux-gnuabi64
- name: configure - name: configure
run: | run: |
mkdir build && cd build mkdir build && cd build
cmake .. -DULIB_BUILD_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=../toolchains/mips64el-linux-gnuabi64.toolchain.cmake -DCMAKE_CROSSCOMPILING_EMULATOR="qemu-mips64el;-L;/usr/mips64el-linux-gnuabi64" cmake .. -DSLED_BUILD_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=../toolchains/mips64el-linux-gnuabi64.toolchain.cmake -DCMAKE_CROSSCOMPILING_EMULATOR="qemu-mips64el;-L;/usr/mips64el-linux-gnuabi64"
- name: build - name: build
run: cmake --build build --target all -j `nproc` run: cmake --build build --target all -j `nproc`
- name: test - name: test

View File

@ -40,7 +40,14 @@ jobs:
- name: configure - name: configure
run: | run: |
mkdir build && cd build mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=${{matrix.build_type}} cmake .. -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DSLED_BUILD_TESTS=ON -DSLED_BUILD_BENCHMARK=ON
- name: build - name: build
run: | run: |
cmake --build build -j `nproc` cmake --build build -j `nproc`
- name: test
run: |
cd build
ctest --output-on-failure -j`nproc`
- name: benchmark
run: |
./build/sled_benchmark