[CI] Try to build Boost + LLVM + RG3 at once and upload artifacts #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- "*" | |
tags: | |
- "*" | |
jobs: | |
build_rg3: | |
runs-on: ${{ matrix.config.os }} | |
strategy: | |
matrix: | |
config: | |
- { name: "Windows MSVC", os: windows-latest, cc: "cl", cxx: "cl", boost_toolset: msvc } | |
steps: | |
# Download repository with submodules | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
# Setup Ninja | |
- name: Get latests Ninja | |
uses: ashutoshvarma/setup-ninja@master | |
# Check cache of Boost & LLVM - take if exists | |
# Build Boost 1.81.0 | |
- name: Install Boost 1.81.0 | |
uses: MarkusJx/[email protected] | |
id: install-boost | |
with: | |
boost_version: 1.81.0 | |
toolset: msvc | |
link: static | |
# Try to locate llvm binaries | |
- name: Cache LLVM binaries | |
id: cache-llvm-binaries | |
uses: actions/cache@v3 | |
with: | |
key: "${{ runner.os }}-build-llvmorg-16.0.4" | |
path: | | |
llvm_repo/build/MinSizeRel | |
llvm_repo/llvm/include | |
llvm_repo/clang/include | |
llvm_repo/clang-tools-extra/include | |
llvm_repo/cmake | |
# Checkout & Build LLVM 16.0.4 (Need check cache here. On cache miss - build from scratch!) | |
- name: Checkout LLVM | |
if: steps.cache-llvm-binaries.outputs.cache-hit != 'true' | |
uses: actions/checkout@v3 | |
with: | |
submodules: "recursive" | |
repository: "llvm/llvm-project" | |
ref: "llvmorg-16.0.4" | |
path: "llvm_repo" | |
- name: Build LLVM | |
if: steps.cache-llvm-binaries.outputs.cache-hit != 'true' | |
working-directory: llvm_repo | |
run: | | |
mkdir build | |
cmake -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_BUILD_TYPE="MinSizeRel" -S llvm -B build -G Ninja | |
cd build | |
cmake --build . --config MinSizeRel | |
# Build our project | |
- name: Build RG3 | |
env: | |
LLVM_DIR: ${{ github.workspace }}/llvm_repo/build/lib/cmake/llvm | |
CLANG_DIR: ${{ github.workspace }}/llvm_repo/build/lib/cmake/clang | |
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} | |
run: | | |
mkdir build | |
cmake -DCMAKE_BUILD_TYPE="MinSizeRel" -B build -G Ninja | |
cd build | |
cmake -- build . --config MinSizeRel | |
- name: Create distribution package | |
run: | | |
mkdir dist | |
mv PyBind/rg3py.pyi dist | |
mv build/PyBind/rg3py.pyd dist | |
- name: Upload RG3 artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: "RG3" | |
path: dist |