Skip to content

Commit

Permalink
test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Oct 31, 2023
1 parent 2af26b4 commit 26e50df
Showing 1 changed file with 159 additions and 1 deletion.
160 changes: 159 additions & 1 deletion .ci/test-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,164 @@ jobs:
- name: codecov
run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info

linux-gcc-powerpc:
name: linux-gcc-powerpc
strategy:
matrix:
OPENMP: ['OFF', 'ON']

runs-on:
pool-name: docker
container:
image: bkci/ci:ubuntu
steps:
- name: checkout
checkout: self
with:
strategy: FRESH_CHECKOUT
enableSubmodule: false
enableGitLfs: false

- name: install-deps
run: |
apt-get update
apt-get install -y lcov g++-powerpc-linux-gnu libcapstone4 libglib2.0-0
curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
- name: cache-qemu
id: cache-qemu
uses: cache@1.*
with:
cachePaths: qemu-install
cacheKey: qemu-ppc-install-20220831-1

- name: checkout-qemu
if: steps.cache-qemu.outputs.cacheHit != 'true'
checkout: https://github.com/qemu/qemu.git
with:
pullType: COMMIT_ID
refName: 621da7789083b80d6f1ff1c0fb499334007b4f51
localPath: qemu
enableSubmodule: false
enableGitLfs: false

- name: qemu
if: steps.cache-qemu.outputs.cacheHit != 'true'
run: |
echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list
echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list
apt-get update
apt-get build-dep -y qemu
cd qemu
./configure --prefix=${{ci.workspace}}/qemu-install --target-list=ppc-linux-user --disable-system
make -j$(nproc)
make install
- name: build
run: |
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/powerpc-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_OPENMP=${{matrix.OPENMP}} -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
cmake --build . -j $(nproc)
- name: test
run: |
export PATH=${{ci.workspace}}/qemu-install/bin:$PATH
cd build
TESTS_EXECUTABLE_LOADER=qemu-ppc TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/powerpc-linux-gnu" ctest --output-on-failure -j $(nproc)
- name: lcov-collect
run: |
cd build
lcov -d ./src -c -o lcov.info
lcov -r lcov.info '/usr/*' -o lcov.info
lcov -r lcov.info '*/build/*' -o lcov.info
lcov --list lcov.info
- name: codecov
run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info

linux-gcc-powerpc64le:
name: linux-gcc-powerpc64le
strategy:
matrix:
OPENMP: ['OFF', 'ON']

runs-on:
pool-name: docker
container:
image: bkci/ci:ubuntu
steps:
- name: checkout
checkout: self
with:
strategy: FRESH_CHECKOUT
enableSubmodule: false
enableGitLfs: false

- name: install-deps
run: |
apt-get update
apt-get install -y lcov g++-powerpc64le-linux-gnu libcapstone4 libglib2.0-0
curl https://uploader.codecov.io/verification.gpg | gpg --no-default-keyring --keyring trustedkeys.gpg --import
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
- name: cache-qemu
id: cache-qemu
uses: cache@1.*
with:
cachePaths: qemu-install
cacheKey: qemu-ppc64le-install-20220831-1

- name: checkout-qemu
if: steps.cache-qemu.outputs.cacheHit != 'true'
checkout: https://github.com/qemu/qemu.git
with:
pullType: COMMIT_ID
refName: 621da7789083b80d6f1ff1c0fb499334007b4f51
localPath: qemu
enableSubmodule: false
enableGitLfs: false

- name: qemu
if: steps.cache-qemu.outputs.cacheHit != 'true'
run: |
echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye main' | tee -a /etc/apt/sources.list
echo 'deb-src http://mirrors.cloud.tencent.com/debian bullseye-updates main' | tee -a /etc/apt/sources.list
apt-get update
apt-get build-dep -y qemu
cd qemu
./configure --prefix=${{ci.workspace}}/qemu-install --target-list=ppc64le-linux-user --disable-system
make -j$(nproc)
make install
- name: build
run: |
mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/powerpc64le-linux-gnu.toolchain.cmake -DCMAKE_BUILD_TYPE=debug -DNCNN_COVERAGE=ON -DNCNN_RUNTIME_CPU=OFF -DNCNN_OPENMP=${{matrix.OPENMP}} -DNCNN_BUILD_TOOLS=OFF -DNCNN_BUILD_EXAMPLES=OFF -DNCNN_BUILD_TESTS=ON ..
cmake --build . -j $(nproc)
- name: test
run: |
export PATH=${{ci.workspace}}/qemu-install/bin:$PATH
cd build
TESTS_EXECUTABLE_LOADER=qemu-ppc64le TESTS_EXECUTABLE_LOADER_ARGUMENTS="-L;/usr/powerpc64le-linux-gnu" ctest --output-on-failure -j $(nproc)
- name: lcov-collect
run: |
cd build
lcov -d ./src -c -o lcov.info
lcov -r lcov.info '/usr/*' -o lcov.info
lcov -r lcov.info '*/build/*' -o lcov.info
lcov --list lcov.info
- name: codecov
run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info

linux-gcc-riscv64:
name: linux-gcc-riscv64
strategy:
Expand Down Expand Up @@ -951,4 +1109,4 @@ jobs:
lcov -r lcov.info '*/build/*' -o lcov.info
lcov --list lcov.info
- name: codecov
run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info
run: ./codecov -t ${{settings.CODECOV_TOKEN.access_token}} -C ${{ ci.sha }} -B ${{ ci.head_ref }} -f build/lcov.info

0 comments on commit 26e50df

Please sign in to comment.