2023-12-05 10:05:36 +08:00
|
|
|
name: rpcrypto-build
|
|
|
|
on:
|
2023-12-05 16:44:08 +08:00
|
|
|
push:
|
|
|
|
paths:
|
2023-12-13 13:07:36 +08:00
|
|
|
- ".gitea/workflows/build.yaml"
|
|
|
|
- "toolchains/hisiv510.toolchain.cmake"
|
|
|
|
- "toolchains/himix200.toolchain.cmake"
|
2023-12-13 13:08:39 +08:00
|
|
|
- "toolchains/mipsel-openwrt-linux-musl.toolchain.cmake"
|
|
|
|
- "toolchains/mipsel-openwrt-linux.toolchain.cmake"
|
2023-12-13 13:07:36 +08:00
|
|
|
- "src/**"
|
2023-12-26 21:25:11 +08:00
|
|
|
- "3party/**"
|
2023-12-13 13:07:36 +08:00
|
|
|
- "tests/**"
|
|
|
|
- "CMakeLists.txt"
|
|
|
|
- "cmake/**"
|
2023-12-05 16:44:08 +08:00
|
|
|
pull_request:
|
|
|
|
paths:
|
2023-12-13 13:07:36 +08:00
|
|
|
- ".gitea/workflows/build.yaml"
|
|
|
|
- "toolchains/hisiv510.toolchain.cmake"
|
|
|
|
- "toolchains/himix200.toolchain.cmake"
|
|
|
|
- "toolchains/mipsel-openwrt-linux-musl.toolchain.cmake"
|
|
|
|
- "toolchains/mipsel-openwrt-linux.toolchain.cmake"
|
2023-12-26 21:25:11 +08:00
|
|
|
- "3party/**"
|
2023-12-13 13:07:36 +08:00
|
|
|
- "src/**"
|
|
|
|
- "tests/**"
|
|
|
|
- "CMakeLists.txt"
|
|
|
|
- "cmake/**"
|
2023-12-05 10:05:36 +08:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build_type:
|
|
|
|
- Debug
|
|
|
|
- Release
|
|
|
|
toolchain:
|
2023-12-05 17:12:51 +08:00
|
|
|
# - host-afl.toolchain.cmake
|
2023-12-05 10:05:36 +08:00
|
|
|
- hisiv510.toolchain.cmake
|
|
|
|
- himix200.toolchain.cmake
|
2023-12-13 13:08:39 +08:00
|
|
|
# - mipsel-openwrt-linux-musl.toolchain.cmake
|
|
|
|
# - mipsel-openwrt-linux.toolchain.cmake
|
2023-12-05 10:05:36 +08:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
env:
|
|
|
|
build_command: |
|
|
|
|
cd ${{ github.workspace }}
|
|
|
|
pwd
|
|
|
|
ls -alh
|
|
|
|
# /bin/bash scripts/install-flatc.sh
|
|
|
|
cmake . -Bbuild \
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE=toolchains/${{ matrix.toolchain }} \
|
|
|
|
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=./install \
|
2023-12-05 15:52:30 +08:00
|
|
|
-DCMAKE_VERBOSE_MAKEFILE=ON ${CUSTOM_CMAKE_ARGS}
|
2023-12-05 10:05:36 +08:00
|
|
|
cmake --build build --config ${{ matrix.build_type }} --target all -- -j `nproc`
|
|
|
|
cmake --build build --config ${{ matrix.build_type }} --target install
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2023-12-05 15:55:33 +08:00
|
|
|
with:
|
|
|
|
submodules: true
|
|
|
|
fetch-depth: 1
|
|
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
2023-12-05 15:56:51 +08:00
|
|
|
- name: build-host
|
2023-12-05 10:05:36 +08:00
|
|
|
if: matrix.toolchain == 'host.toolchain.cmake'
|
|
|
|
run: |
|
2023-12-05 14:31:13 +08:00
|
|
|
sudo apt-get update -y
|
|
|
|
sudo apt-get install -y libarchive-dev libssl-dev autoconf libtool pkg-config cmake make gcc g++
|
2023-12-13 13:07:36 +08:00
|
|
|
${{ env.build_command }}
|
2023-12-05 15:46:14 +08:00
|
|
|
|
|
|
|
- name: run_gtest
|
|
|
|
if: matrix.toolchain == 'host.toolchain.cmake'
|
|
|
|
run: |
|
|
|
|
cd ${{ github.workspace }}
|
2023-12-13 13:07:36 +08:00
|
|
|
cmake --build build --config ${{ matrix.build_type }} --target test
|
2023-12-05 10:05:36 +08:00
|
|
|
|
2023-12-05 15:56:51 +08:00
|
|
|
- name: build-host-afl
|
2023-12-05 10:05:36 +08:00
|
|
|
if: matrix.toolchain == 'host-afl.toolchain.cmake'
|
|
|
|
run: |
|
2023-12-05 14:43:11 +08:00
|
|
|
sudo apt-get update -y
|
|
|
|
sudo apt-get install -y libarchive-dev libssl-dev autoconf libtool pkg-config afl++ cmake make gcc g++
|
2023-12-05 10:05:36 +08:00
|
|
|
export AFL_LLVM_LAF_ALL=1
|
|
|
|
export CC=/usr/bin/afl-clang-fast
|
|
|
|
export CXX=/usr/bin/afl-clang-fast++
|
2023-12-05 15:52:30 +08:00
|
|
|
export CUSTOM_CMAKE_ARGS="-DULIB_BUILD_TESTS=ON"
|
2023-12-05 10:05:36 +08:00
|
|
|
${{ env.build_command }}
|
|
|
|
|
2023-12-08 13:38:46 +08:00
|
|
|
- name: build-in-container
|
2023-12-05 10:05:36 +08:00
|
|
|
uses: addnab/docker-run-action@v3
|
|
|
|
if: matrix.toolchain != 'host.toolchain.cmake' && matrix.toolchain != 'host-afl.toolchain.cmake'
|
|
|
|
with:
|
2023-12-08 13:38:46 +08:00
|
|
|
image: tqcq/ubuntu:hisi
|
2023-12-05 10:05:36 +08:00
|
|
|
options: --rm --volumes-from ${{ env.JOB_CONTAINER_NAME }}
|
|
|
|
run: |
|
2023-12-08 13:38:46 +08:00
|
|
|
cd ${{ github.workspace }}
|
|
|
|
sudo apt-get update
|
2024-01-06 21:01:43 +08:00
|
|
|
sudo apt-get install -y libarchive-dev libssl-dev autoconf libtool pkg-config cmake make gcc g++ git
|
2023-12-13 13:07:36 +08:00
|
|
|
${{ env.build_command }}
|