Skip to content

Chore: Updated upstream dwarfs #496

Chore: Updated upstream dwarfs

Chore: Updated upstream dwarfs #496

Workflow file for this run

# Copyright (c) 2021-2023 [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: 1
jobs:
build:
name: ${{ matrix.os }} [CC clang, ASAN ${{ matrix.env.ASAN }}, COVERAGE ${{ matrix.env.COVERAGE }}, ${{ matrix.env.LOG_LEVEL }} ]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ macos-11 ]
env:
- { ASAN: 'OFF', COVERAGE: 'OFF', LOG_LEVEL: 'warn', xcode: '12.4' }
env: ${{ matrix.env }}
steps:
- name: Select XCode 12.4 & SDK 11.1
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ matrix.env.xcode }}
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Setup environment
run: |
cat common.env macos-x86_64.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@v3
with:
path: ${{ github.workspace }}/${{ env.DEPS }}
key: ${{ matrix.os }}-clang-${{ hashFiles('**/common.env') }}-${{ env.ASAN }}-${{ env.COVERAGE }}-${{ env.LOG_LEVEL }}-v${{ env.CACHE_VER }}
- name: Install packages
# Already installed: openssl, libevent, libsodium, lz4, xz, zlib
# 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 pkg-config
- name: Configure
run: cmake -B build -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@v3
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
uses: actions/upload-artifact@v3
with:
name: tests
retention-days: 1
path: |
${{github.workspace}}/build/wr-bin
${{github.workspace}}/build/wr-tests
test-on-macos-12:
needs: build
name: run tests on MacOS-12/13
runs-on: ${{ matrix.os }}
env:
TEBAKO_CROSS_TEST: ON
strategy:
fail-fast: false
matrix:
os: [ macos-12, macos-13 ]
steps:
- name: Download tests
uses: actions/download-artifact@v3
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