add cmake #190
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build-macos | |
on: push | |
jobs: | |
test: | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
build: [Debug, Release] | |
standard: [cxx23] | |
defaults: | |
run: | |
shell: bash | |
name: "${{matrix.standard}}-${{matrix.build}}" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Dependency | |
run: brew install cxxopts fmt llvm@14 | |
- name: Checkout | |
run: git submodule update --init | |
- name: Install WASI SDK | |
run: | | |
cd /opt | |
sudo wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-macos.tar.gz | |
sudo tar -xzf wasi-sdk-*.tar.gz | |
sudo mv wasi-sdk-20.0 wasi-sdk | |
- name: Make WASI Socket Ext | |
run: | | |
cd lib/wasm-micro-runtime/samples/socket-api/ | |
cmake . | |
make -j | |
- name: Make WASM LD no check features | |
run: | | |
sudo mv /opt/wasi-sdk/bin/wasm-ld /opt/wasi-sdk/bin/wasm-ld.bak | |
echo '#!/bin/bash | |
/opt/wasi-sdk/bin/wasm-ld.bak --no-check-features "$@"' | sudo tee /opt/wasi-sdk/bin/wasm-ld | |
sudo chmod +x /opt/wasi-sdk/bin/wasm-ld | |
- name: configure cmake | |
run: cmake -S $GITHUB_WORKSPACE -B ${{runner.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.build}} -DLLVM_DIR=/usr/local/opt/llvm@14/lib/cmake/llvm/ | |
- name: build | |
working-directory: ${{runner.workspace}}/build | |
run: cmake --build . --config ${{matrix.build}} | |
- name: test | |
working-directory: ${{runner.workspace}}/build | |
run: ctest -V |