Skip to content

Minor tweaks to fix compilation with ZIG. #80

Minor tweaks to fix compilation with ZIG.

Minor tweaks to fix compilation with ZIG. #80

Workflow file for this run

name: CI or PR
# To test fastlane build commands on your local machine, install fastlane.
# sudo gem install fastlane -NV
#
on:
push:
branches:
- 'master'
- 'main'
- 'devel'
tags:
- '*' # Test all pushed tags.
pull_request:
types:
- labeled
- unlabeled
- synchronize
- opened
- edited
- ready_for_review
- reopened
- unlocked
pull_request_review:
types:
- submitted
env:
RELEASE: release
jobs:
# Run unit tests
unit-tests:
name: Build and run unit tests
strategy:
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest] #
runs-on: ${{ matrix.platform }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Emscripten Install
if: (matrix.platform == 'ubuntu-latest')
uses: mymindstorm/setup-emsdk@v7
with:
# Make sure to set a version number!
version: 2.0.12
# This is the name of the cache folder.
# The cache folder will be placed in the build directory,
# so make sure it doesn't conflict with anything!
actions-cache-folder: 'emsdk-cache'
- name: Emscripten build and test
if: (matrix.platform == 'ubuntu-latest')
run: |
sh emscripten_build.sh
- name: Cleanup from last time
if: (matrix.platform == 'self-hosted')
run: rm -rf build
- name: Add msbuild to PATH (windows).
if: (matrix.platform == 'windows-latest')
uses: microsoft/setup-msbuild@v1.0.2
- name: Run cmake
run: |
mkdir build
pushd build
cmake ..
popd
- name: Build unit tests
if: (matrix.platform != 'windows-latest')
run: |
pushd build
make -j4
popd
- name: Build unit tests (windows).
if: (matrix.platform == 'windows-latest')
run: |
pushd build
msbuild sweet_osal_platform.sln /property:Configuration=Debug -maxcpucount:4
popd
- name: Run unit tests.
if: (github.workflow != 'CD')
run: |
cd build
ctest -j4
cd ..
- name: Install zig on macos-latest
if: (matrix.platform == 'macos-latest')
run: |
brew install zig
- name: Build unit tests using zig
if: (matrix.platform == 'macos-latest')
env:
CC: 'zig cc'
CXX: 'zig c++'
run: |
mkdir -p zig_build
pushd zig_build
cmake ..
make -j8
popd
- name: Run unit tests using zig
if: (matrix.platform == 'macos-latest') && (github.workflow != 'CD')
env:
CC: 'zig cc'
CXX: 'zig c++'
run: |
pushd zig_build
ctest -j8
popd