Skip to content

multiarch build on dispatch #511

multiarch build on dispatch

multiarch build on dispatch #511

name: multiarch build on dispatch
on:
workflow_dispatch:
schedule:
- cron: "17 1 * * *" ## at 01:17
jobs:
build:
name: Build
continue-on-error: false
strategy:
matrix:
target:
# - id: 'linux-amd64-distribution'
# os: 'ubuntu-latest'
# tar_extra_args: ''
# llvm_version: '18.x'
# build_target: 'distribution'
- id: 'linux-amd64'
os: 'ubuntu-latest'
tar_extra_args: ''
- id: 'linux-aarch64'
os: "ubuntu-24.04-arm"
# os: ['self-hosted', 'linux', 'ARM64']
# - id: 'linux-riscv64'
# os: "ubuntu-latest"
# os: ['self-hosted', 'linux', 'RISCV64']
## https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/
- id: 'darwin-amd64'
os: 'macos-latest'
tar_extra_args: ''
- id: 'windows-amd64'
os: 'windows-latest'
# When unpacking an archive on Windows, the symlinks can't be
# created unless the target path already exists. This causes
# problems when the linked file is ordered after the link
# inside the archive. Dereferencing the files when packing them
# adds an additional copy per link, but it reliably works and
# the additional size is not too large on Windows.
tar_extra_args: '--dereference'
# llvm_version: ['17.x']
fail-fast: true
runs-on: ${{ matrix.target.os }}
steps:
- name: Check out the code
uses: actions/checkout@v4
with:
fetch-depth: 2
repository: Haldir65/ronan
token: ${{ secrets.ACCESS_TOKEN }}
ref: 'master'
path: ronan
- name: Cache Boost artifact
id: cache-boost
uses: actions/cache@v4
with:
path: ronan/cmake/vendor/boost-1.87.0-cmake.tar.xz
key: ${{ runner.os }}-boost-1.87.0
- name: Retrieve boost cache
if: steps.cache-boost.outputs.cache-hit != 'true'
run: echo "boost cache is not found locally"
- name: Cache build cache
id: cache-deps
uses: actions/cache@v4
with:
path: ronan/build/_deps
key: ${{ runner.os }}-build_deps-v1
# - name: Install LLVM and Clang on linux
# if: startsWith(matrix.target.id, 'linux-')
# uses: KyleMayes/install-llvm-action@v2
# with:
# version: "17.0"
- name: Install `ninja` on Ubuntu
if: startsWith(matrix.target.id, 'linux-')
shell: bash
run: |
sudo apt install ninja-build build-essential coreutils tree libtbb-dev -y
clang --version
echo "cpu core num is "
nproc
- name: Install `ninja llvm cmake ` on macOS
if: startsWith(matrix.target.id, 'darwin-')
shell: bash
run: |
brew install ninja llvm tree
clang --version
echo "BREW_INSTALL_PREFIX=$(brew --prefix llvm)" >> $GITHUB_ENV
echo "${BREW_INSTALL_PREFIX}/bin"
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
clang --version
echo "llvm"
/opt/homebrew/opt/llvm/bin/clang --version
- name: Build (mac or linux)
if: startsWith(matrix.target.id, 'linux-') || startsWith(matrix.target.id, 'darwin-')
shell: bash
working-directory: ronan
run: |
chmod +x ./scripts/build.sh
./scripts/build.sh
- name: Build (Windows)
if: matrix.target.id == 'windows-amd64'
working-directory: ronan
shell: |
powershell -Command "& '{0}'"
run: |
./scripts/build.ps1
- name: show layouts (unix)
if: startsWith(matrix.target.id, 'linux-') || startsWith(matrix.target.id, 'darwin-')
shell: bash
working-directory: ronan
run: |
tree -L 3 build
- name: Inspect
shell: bash
working-directory: ronan
run: |
# for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# do
# echo "Mendax Current number: $i"
# if [[ "${{ matrix.target.id }}" == 'windows-amd64' ]]; then
# PATH=build/apps/Release:$PATH main.exe --verbose true --filename "cmake/hello/resources/twitter.json" --dir "cmake/hello/resources" --mode $i
# else
# ASAN_OPTIONS=alloc_dealloc_mismatch=0 PATH=build/apps:$PATH main --verbose true --filename "cmake/hello/resources/twitter.json" --dir "cmake/hello/resources" --mode $i
# fi
# done
if [[ "${{ matrix.target.id }}" == 'windows-amd64' ]]; then
powershell -executionpolicy bypass -File scripts/test.ps1
else
bash scripts/test.sh
fi
# - name: run benchmark
# # if: startsWith(matrix.target.id, 'darwin-') || startsWith(matrix.target.id, 'linux-')
# shell: bash
# working-directory: ronan
# run: |
# bash scripts/run_benchmark.sh
# - name: Zip
# shell: bash
# run: |
# mkdir -p dist
# if [[ "${{ matrix.target.id }}" == 'windows-amd64' ]]; then
# tar -cvzf dist/main-${{ matrix.target.id }}.tar.gz -C build/apps/Release main.exe
# else
# tar -cvzf dist/main-${{ matrix.target.id }}.tar.gz -C build/apps main
# fi
# - name: Upload Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.target.id }}-main
# path: dist
# if-no-files-found: error
# retention-days: 7
dockerBuild:
name: Build project in docker container
# if: "contains(github.event.head_commit.message, '[atomated]')"
continue-on-error: false
runs-on: ubuntu-latest
strategy:
matrix:
container: [ "silkeh/clang:19-bookworm" ,
"haldir65/hello-docker-hub:clang20-cmake3.30.4",
"ubuntu:24.04"
]
container:
image: docker://${{ matrix.container }}
steps:
- name: Check out the code
uses: actions/checkout@v4
with:
fetch-depth: 2
repository: Haldir65/ronan
token: ${{ secrets.ACCESS_TOKEN }}
ref: 'master'
path: ronan
- name: Cache Boost artifact
id: cache-boost
uses: actions/cache@v4
with:
path: ronan/cmake/vendor/boost-1.87.0-cmake.tar.xz
key: ${{ runner.os }}-boost-1.87.0
- name: Retrieve boost cache
if: steps.cache-boost.outputs.cache-hit != 'true'
run: echo "boost cache is not found locally"
- name: Cache build cache
id: cache-deps
uses: actions/cache@v4
with:
path: ronan/build/_deps
key: ${{ runner.os }}-build_deps-v1
- name: install dependency on debian
shell: bash
run: |
apt update
apt install -y sudo ninja-build git unzip build-essential tree checkinstall zlib1g-dev libtbb-dev wget
- name: install latest version of cmake
shell: bash
if: matrix.container == 'silkeh/clang:19-bookworm' || matrix.container == 'ubuntu:24.04'
run: |
wget -qO- "https://github.com/Kitware/CMake/releases/download/v3.30.4/cmake-3.30.4-linux-x86_64.tar.gz" | tar --strip-components=1 -xz -C /usr/local
/usr/local/bin/cmake --version
echo $PATH
which cmake
cmake --version
- name: Show clang version
shell: bash
if: matrix.container != 'gcc:13.2.0' && matrix.container != 'ubuntu:24.04'
run: |
clang --version
cmake --version
which clang
which cmake
- name: Show compiler info [gcc]
shell: bash
run: |
gcc --version
g++ --version
which gcc
- name: Build in docker conatiners
shell: bash
working-directory: ronan
run: |
chmod +x ./scripts/build.sh
./scripts/build.sh
- name: show layouts
shell: bash
working-directory: ronan
run: |
tree -L 3 build
# https://twitter.com/zeuxcg/status/1769957028167111096
- name: work round for address sanitizer
if: startsWith(matrix.container, 'haldir65/hello-docker-hub')
shell: bash
run: |
sysctl -w vm.mmap_rnd_bits=28
- name: Inspect
shell: bash
working-directory: ronan
run: |
# for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# do
# echo "Mendax Current number: $i"
# ASAN_OPTIONS=alloc_dealloc_mismatch=0 PATH=build/apps:$PATH main --verbose true --filename "cmake/hello/resources/twitter.json" --dir "cmake/hello/resources" --mode $i
# done
bash scripts/test.sh
# - name: run benchmark
# shell: bash
# working-directory: ronan
# run: |
# bash scripts/run_benchmark.sh
# - name: Zip
# shell: bash
# run: |
# mkdir -p dist
# tar -cvzf dist/main-app.tar.gz -C build/apps main
# - name: Upload Artifacts
# uses: actions/upload-artifact@v4
# with:
# name: app-main
# path: dist
# if-no-files-found: error
# retention-days: 7