2023-12-03 08:04:44 +08:00
|
|
|
name: build-crpc
|
|
|
|
on:
|
|
|
|
- push
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
build_type:
|
|
|
|
- Debug
|
|
|
|
- Release
|
|
|
|
toolchain:
|
2023-12-03 08:09:34 +08:00
|
|
|
- mingw-w64-x86_64.toolchain.cmake
|
2023-12-03 12:12:30 +08:00
|
|
|
- mingw-w64-xi686.toolchain.cmake
|
2023-12-03 08:04:44 +08:00
|
|
|
- host.toolchain.cmake
|
|
|
|
steps:
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: |
|
2023-12-03 12:12:30 +08:00
|
|
|
# uuid-dev is required by antlr4
|
2023-12-03 08:04:44 +08:00
|
|
|
apt-get update -y
|
|
|
|
apt-get install -y \
|
2023-12-03 12:14:14 +08:00
|
|
|
cmake make g++ libssl-dev pkg-config autoconf libtool libantlr4-runtime-dev default-jre-headless mingw-w64 \
|
2023-12-03 12:12:30 +08:00
|
|
|
uuid-dev
|
|
|
|
|
2023-12-03 08:04:44 +08:00
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Generate Lexer and Parser
|
|
|
|
run: |
|
|
|
|
cd ${{ github.workspace }}/src/grammar
|
2023-12-03 08:31:59 +08:00
|
|
|
wget -q -t 3 https://www.antlr.org/download/antlr-4.13.1-complete.jar -O antlr.jar
|
2023-12-03 08:04:44 +08:00
|
|
|
java -jar antlr.jar -Dlanguage=Cpp -o ./ ProtoLexer.g4
|
|
|
|
java -jar antlr.jar -Dlanguage=Cpp -o ./ ProtoParser.g4
|
2023-12-03 08:34:17 +08:00
|
|
|
ls -lh
|
2023-12-03 08:09:34 +08:00
|
|
|
- name: Configure CRPC
|
|
|
|
run: |
|
|
|
|
cd ${{ github.workspace }}
|
2023-12-03 08:14:03 +08:00
|
|
|
# use static link
|
|
|
|
cmake . -Bbuild \
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE=toolchains/${{ matrix.toolchain }} \
|
|
|
|
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
|
|
|
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
|
|
|
-DCMAKE_CXX_FLAGS="-static-libgcc -static-libstdc++" \
|
|
|
|
-DCMAKE_C_FLAGS="-static-libgcc -static-libstdc++"
|
2023-12-03 08:09:34 +08:00
|
|
|
|
|
|
|
- name: Build CRPC
|
|
|
|
run: |
|
|
|
|
cmake --build build --config ${{ matrix.build_type }} --target all -- -j `nproc`
|
|
|
|
|
|
|
|
- name: Upload Artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: crpc-${{ matrix.toolchain }}-${{ matrix.build_type }}
|
|
|
|
path: ${{ github.workspace }}/build/crpc
|