Skip to content

Commit

Permalink
use spatial-model-editor/setup-ci action
Browse files Browse the repository at this point in the history
  • Loading branch information
lkeegan committed Apr 10, 2024
1 parent 7a4d4b6 commit 72c87af
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 107 deletions.
134 changes: 35 additions & 99 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,124 +32,60 @@ env:
SCOTCH_VERSION: "v7.0.4"

jobs:
linux:
name: Linux
runs-on: ubuntu-20.04
env:
HOST_TRIPLE: "x86_64-unknown-linux-gnu"
INSTALL_PREFIX: "/opt/smelibs"
SUDOCMD: "sudo"
OS_TARGET: "linux"
CC: "clang"
CXX: "clang++"
BOOST_INSTALL_PREFIX: "/opt/smelibs"
BOOST_BOOTSTRAP_OPTIONS: "--with-toolset=clang"
BOOST_B2_OPTIONS: "cxxflags=-fPIC"
TBB_ENABLE_IPO: "ON"
VTK_OPTIONS: ""
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: "ubuntu-20.04"
shell: "bash"
BOOST_INSTALL_PREFIX: "/opt/smelibs"
BOOST_BOOTSTRAP_OPTIONS: "--with-toolset=clang"
BOOST_B2_OPTIONS: "cxxflags=-fPIC"
TBB_ENABLE_IPO: "ON"
- os: "macos-13"
shell: "bash"
BOOST_INSTALL_PREFIX: "/opt/smelibs"
BOOST_B2_OPTIONS: 'cxxflags="-mmacosx-version-min=11" linkflags="-mmacosx-version-min=11"'
TBB_ENABLE_IPO: "ON"
VTK_OPTIONS: "-DFREETYPE_LIBRARY_RELEASE=/opt/smelibs/lib/libQt6BundledFreetype.a -DFREETYPE_INCLUDE_DIR_freetype2=/opt/smelibs/include/QtFreetype -DFREETYPE_INCLUDE_DIR_ft2build=/opt/smelibs/include/QtFreetype"
- os: "windows-2022"
shell: "msys2 {0}"
BOOST_INSTALL_PREFIX: "C:/smelibs"
BOOST_B2_OPTIONS: "address-model=64"
TBB_ENABLE_IPO: "OFF"
VTK_OPTIONS: "-DFREETYPE_LIBRARY_RELEASE=/c/smelibs/lib/libQt6BundledFreetype.a -DFREETYPE_INCLUDE_DIR_freetype2=/c/smelibs/include/QtFreetype -DFREETYPE_INCLUDE_DIR_ft2build=/c/smelibs/include/QtFreetype"
defaults:
run:
shell: bash
steps:
- name: Add llvm repo for clang 18
run: |
sudo wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main"
- name: Qt6 build dependencies
run: |
sudo apt update -yy
sudo apt install -yy clang-18 libglu1-mesa-dev libx11-dev libx11-xcb-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev libxkbcommon-dev libxkbcommon-x11-dev '^libxcb.*-dev'
- name: Disable system blas/lapack
run: |
sudo rm /usr/lib/x86_64-linux-gnu/libblas*
sudo rm /usr/lib/x86_64-linux-gnu/liblapack*
- name: Set clang version
run: |
sudo update-alternatives --remove-all clang || echo "nothing to remove"
sudo update-alternatives --remove-all clang++ || echo "nothing to remove"
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100
- uses: actions/checkout@v4
- name: Build script
run: ./build.sh
- uses: actions/upload-artifact@v4
with:
name: artifacts-linux
path: ./artefacts/*

macos:
name: MacOS
runs-on: macos-13
shell: ${{ matrix.shell }}
env:
HOST_TRIPLE: "x86_64-apple-darwin16"
INSTALL_PREFIX: "/opt/smelibs"
SUDOCMD: "sudo"
MACOSX_DEPLOYMENT_TARGET: "11"
OS_TARGET: "osx"
BOOST_INSTALL_PREFIX: "/opt/smelibs"
BOOST_BOOTSTRAP_OPTIONS: ""
BOOST_B2_OPTIONS: 'cxxflags="-mmacosx-version-min=11" linkflags="-mmacosx-version-min=11"'
TBB_ENABLE_IPO: "ON"
VTK_OPTIONS: "-DFREETYPE_LIBRARY_RELEASE=/opt/smelibs/lib/libQt6BundledFreetype.a -DFREETYPE_INCLUDE_DIR_freetype2=/opt/smelibs/include/QtFreetype -DFREETYPE_INCLUDE_DIR_ft2build=/opt/smelibs/include/QtFreetype"
defaults:
run:
shell: bash
BOOST_INSTALL_PREFIX: ${{ matrix.BOOST_INSTALL_PREFIX }}
BOOST_BOOTSTRAP_OPTIONS: ${{ matrix.BOOST_BOOTSTRAP_OPTIONS }}
BOOST_B2_OPTIONS: ${{ matrix.BOOST_B2_OPTIONS }}
TBB_ENABLE_IPO: ${{ matrix.TBB_ENABLE_IPO }}
VTK_OPTIONS: ${{ matrix.VTK_OPTIONS }}
steps:
- uses: spatial-model-editor/setup-ci@v1
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "14.3"
- run: |
brew install bison flex
echo "/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH" >> $GITHUB_PATH
- name: Build script
run: ./build.sh
- uses: actions/upload-artifact@v4
with:
name: artifacts-macos
path: ./artefacts/*

win64-mingw:
name: Windows 64-bit Mingw
runs-on: windows-2022
env:
HOST_TRIPLE: "x86_64-w64-mingw64"
INSTALL_PREFIX: "/c/smelibs"
SUDOCMD: ""
OS_TARGET: "win64-mingw"
BOOST_INSTALL_PREFIX: "C:/smelibs"
BOOST_BOOTSTRAP_OPTIONS: ""
BOOST_B2_OPTIONS: "address-model=64"
TBB_ENABLE_IPO: "OFF"
VTK_OPTIONS: "-DFREETYPE_LIBRARY_RELEASE=/c/smelibs/lib/libQt6BundledFreetype.a -DFREETYPE_INCLUDE_DIR_freetype2=/c/smelibs/include/QtFreetype -DFREETYPE_INCLUDE_DIR_ft2build=/c/smelibs/include/QtFreetype"

defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v4
- uses: msys2/setup-msys2@v2
with:
msystem: UCRT64
update: true
install: mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-python make m4 git diffutils flex bison
- name: Build script
run: ./build.sh
- uses: actions/upload-artifact@v4
with:
name: artifacts-win64-mingw
name: artifacts-${{ matrix.os }}
path: ./artefacts/*
retention-days: 3

release:
name: Upload Binaries to GitHub Release
needs: [linux, macos, win64-mingw]
needs: [build]
runs-on: ubuntu-latest
# upload binaries to github release if commit is tagged
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')
permissions:
contents: write
steps:
- uses: dev-drprasad/delete-older-releases@v0.3.2
- uses: dev-drprasad/delete-older-releases@v0.3.3
with:
repo: spatial-model-editor/sme_deps_common
keep_latest: 5
Expand Down
16 changes: 8 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ echo "VTK_VERSION: ${VTK_VERSION}"
echo "SCOTCH_VERSION: ${SCOTCH_VERSION}"

NPROCS=4
if [[ "$OS_TARGET" == "osx" ]]; then
if [[ "$OS" == "osx" ]]; then
NPROCS=3
fi
echo "NPROCS: ${NPROCS}"
Expand All @@ -50,17 +50,17 @@ python --version
which cmake
cmake --version

echo "downloading qt & llvm for OS_TARGET: $OS_TARGET"
echo "downloading qt & llvm for OS: $OS"
# download llvm static libs
wget https://github.com/spatial-model-editor/sme_deps_llvm/releases/download/${LLVM_VERSION}/sme_deps_llvm_${OS_TARGET}.tgz
tar xvf sme_deps_llvm_${OS_TARGET}.tgz
wget https://github.com/spatial-model-editor/sme_deps_llvm/releases/download/${LLVM_VERSION}/sme_deps_llvm_${OS}.tgz
tar xvf sme_deps_llvm_${OS}.tgz
# download qt static libs
wget https://github.com/spatial-model-editor/sme_deps_qt/releases/download/${QT_VERSION}/sme_deps_qt_${OS_TARGET}.tgz
tar xvf sme_deps_qt_${OS_TARGET}.tgz
wget https://github.com/spatial-model-editor/sme_deps_qt/releases/download/${QT_VERSION}/sme_deps_qt_${OS}.tgz
tar xvf sme_deps_qt_${OS}.tgz
pwd
ls
# copy libs to desired location: workaround for tar -C / not working on windows
if [[ "$OS_TARGET" == *"win"* ]]; then
if [[ "$OS" == *"win"* ]]; then
mv c/smelibs /c/
ls /c/smelibs
else
Expand Down Expand Up @@ -660,4 +660,4 @@ cd ../../

mkdir artefacts
cd artefacts
tar -zcvf sme_deps_common_${OS_TARGET}.tgz $INSTALL_PREFIX/*
tar -zcvf sme_deps_common_${OS}.tgz $INSTALL_PREFIX/*

0 comments on commit 72c87af

Please sign in to comment.