Skip to content

feat: an option to mount host filesystem folder to dwarfs node #757

feat: an option to mount host filesystem folder to dwarfs node

feat: an option to mount host filesystem folder to dwarfs node #757

Workflow file for this run

# Copyright (c) 2021-2024 [Ribose Inc](https://www.ribose.com).
# All rights reserved.
# This file is a part of tamatebako
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# The purpose of this workflow is to check that build procedures work correctly
# in specific environment. Due to this reason there is no caching. It is done by
# intention. All caching is in upstream projects.
name: MacOS
on:
schedule:
- cron: "0 7 * * 0"
push:
branches: [ main ]
paths-ignore:
- 'docs/**'
- '**.adoc'
- '**.md'
- '.cirrus.yml'
- '.github/workflows/*.yml'
- '!.github/workflows/macos.yml'
pull_request:
paths-ignore:
- 'docs/**'
- '**.adoc'
- '**.md'
- '.cirrus.yml'
- '.github/workflows/*.yml'
- '!.github/workflows/macos.yml'
workflow_dispatch:
concurrency:
group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
cancel-in-progress: true
env:
CACHE_VER: 5
jobs:
build:
name: ${{ matrix.env.os }} [XCode ${{ matrix.env.xcode }}, ASAN ${{ matrix.env.ASAN }}, COVERAGE ${{ matrix.env.COVERAGE }}, ${{ matrix.env.LOG_LEVEL }} ]
runs-on: ${{ matrix.env.os }}
strategy:
fail-fast: false
matrix:
env:
- { os: 'macos-12', arch: 'x86_64', ASAN: 'OFF', COVERAGE: 'OFF', LOG_LEVEL: 'warn', xcode: '13.1' }
- { os: 'macos-14', arch: 'arm64', ASAN: 'OFF', COVERAGE: 'OFF', LOG_LEVEL: 'warn', xcode: '14.3.1', LG_VADDR: 39 }
- { os: 'macos-14', arch: 'arm64', ASAN: 'OFF', COVERAGE: 'OFF', LOG_LEVEL: 'warn', xcode: '15.4' }
env: ${{ matrix.env }}
steps:
- name: Setup XCode ${{ matrix.env.xcode }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.env.xcode }}
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup environment
run: |
cat common.env macos-${{ matrix.env.arch }}.env >> $GITHUB_ENV
echo "CORES=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
echo "MAKEFLAGS=j$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
- name: Create deps folder
run: |
mkdir ${{ github.workspace }}/${{ env.DEPS }}
echo 'BREW_HOME<<EOF' >> $GITHUB_ENV
brew --prefix >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Process cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/${{ env.DEPS }}
key: ${{ matrix.env.os }}-${{ matrix.env.xcode }}-${{ hashFiles('**/common.env') }}-${{ env.ASAN }}-${{ env.COVERAGE }}-${{ env.LOG_LEVEL }}-v${{ env.CACHE_VER }}
- name: Install zlib
if: matrix.env.os == 'macos-14'
run: brew install zlib
- name: Install packages
# Already installed: openssl, libevent, libsodium, lz4, xz
# Not installing [comparing to ubuntu as a baseline] libiberty, libunwind, libdwarf, libelf
run: brew install bison flex gnu-sed bash double-conversion boost jemalloc fmt glog googletest
- name: Configure
run: |
cmake -B build -DPREFER_SYSTEM_GTEST=ON -DWITH_TESTS=ON -DWITH_ASAN=${{ env.ASAN }} -DWITH_COVERAGE=${{ env.COVERAGE }} -DTESTS_LOG_LEVEL=${{ env.LOG_LEVEL }}
- name: Build
run: cmake --build build --parallel "$CORES"
- name: Run unit tests
run: ctest --test-dir build --output-on-failure --parallel "$CORES"
- name: Checkout shell test framework
if: ${{ env.COVERAGE != 'ON' && env.ASAN != 'ON' }}
uses: actions/checkout@v4
with:
repository: kward/shunit2
path: ${{ github.workspace }}/tests/shunit2
fetch-depth: 1
- name: Run additional tests
if: ${{ env.COVERAGE != 'ON' && env.ASAN != 'ON' }}
run: ${{ env.BREW_HOME }}/bin/bash ${{ github.workspace }}/tests/scripts/tests.sh
- name: Upload tests
if: ${{ env.COVERAGE != 'ON' && env.ASAN != 'ON' && env.os == 'macos-12' }}
uses: actions/upload-artifact@v4
with:
name: tests
retention-days: 1
path: |
${{github.workspace}}/build/wr-bin
${{github.workspace}}/build/wr-tests
test-on-macos-13-and-14:
# The run on MacOS 14 is the amd64 on arm64 test
needs: build
name: run tests on MacOS-13/14
runs-on: ${{ matrix.os }}
env:
TEBAKO_CROSS_TEST: ON
strategy:
fail-fast: false
matrix:
os: [ macos-13, macos-14 ]
steps:
- name: Download tests
uses: actions/download-artifact@v4
with:
name: tests
- name: Provision execute permissions
run: |
chmod +x wr-bin
chmod +x wr-tests
- name: Run statically linked application
run: ./wr-bin
- name: Run unit tests
run: ./wr-tests