Skip to content

add demo gif to README #325

add demo gif to README

add demo gif to README #325

Workflow file for this run

# CREDITS
# I took a lot of this code from `cmkr` (developed by Duncan Ogilvie / @mrexodia)
# https://github.com/build-cpp/cmkr/blob/main/.github/workflows/build.yml
name: build
on:
workflow_dispatch:
push:
pull_request:
jobs:
build:
name: Build via muuk (${{ matrix.os }}, ${{ matrix.compiler }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
compiler: msvc
binary_name: muuk.exe
artifact_name: muuk-windows
zip_name: muuk-windows.zip
muuk_exec: .\muuk.exe
copy_cmd: copy build\release\muuk.exe muuk.exe
- os: macos-latest
compiler: clang
binary_name: muuk
artifact_name: muuk-macos
zip_name: muuk-macos.zip
muuk_exec: ./muuk
copy_cmd: cp build/release/muuk muuk
- os: ubuntu-latest
compiler: gcc
binary_name: muuk
artifact_name: muuk-linux
zip_name: muuk-linux.zip
muuk_exec: ./muuk
copy_cmd: cp build/release/muuk muuk
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@v6
- name: Set up MSVC (Windows only)
if: matrix.compiler == 'msvc'
uses: ilammy/msvc-dev-cmd@v1
- name: Use Apple Clang (Xcode)
if: runner.os == 'macOS'
run: |
echo "Using Apple Clang:"
clang++ --version
clang-scan-deps --version || echo "clang-scan-deps not available"
- name: Install LLVM (Linux only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential llvm clang lld
echo "LLVM installed at: $(llvm-config --prefix)"
echo "$(llvm-config --bindir)" >> $GITHUB_PATH
- name: Download latest release
shell: bash
run: |
url=$(gh release view --json assets -q ".assets[] | select(.name == \"${{ matrix.zip_name }}\") | .url")
curl -L "$url" -o muuk.zip
unzip -o muuk.zip
if [[ "${{ runner.os }}" != "Windows" ]]; then
chmod +x muuk
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies with muuk
run: ${{ matrix.muuk_exec }} install
- name: Create build directory
shell: bash
run: |
mkdir -p build/release
mkdir -p build/debug
- name: Build project (Release)
run: ${{ matrix.muuk_exec }} build -c ${{ matrix.compiler }} -p release
- name: Copy executable
run: ${{ matrix.copy_cmd }}
- name: Make executable runnable (chmod +x)
if: runner.os != 'Windows'
run: chmod +x ${{ matrix.binary_name }}
- name: Upload raw binary as artifact (for internal use)
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.binary_name }}
- name: Zip for GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: vimtor/action-zip@v1.1
with:
files: ${{ matrix.binary_name }}
dest: ${{ matrix.zip_name }}
# - name: Upload Release (if tagged)
# if: startsWith(github.ref, 'refs/tags/')
# uses: softprops/action-gh-release@v1
# with:
# prerelease: ${{ !startsWith(github.ref, 'refs/tags/v') || contains(github.ref, '-pre') }}
# files: ${{ matrix.zip_name }}
# generate_release_notes: true
# env:
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
test:
name: Test the built binary
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
artifact_name: muuk-windows
binary_name: muuk.exe
compiler: msvc
muuk_exec: .\muuk.exe
- os: macos-latest
artifact_name: muuk-macos
binary_name: muuk
compiler: clang
muuk_exec: ./muuk
- os: ubuntu-latest
artifact_name: muuk-linux
binary_name: muuk
compiler: gcc
muuk_exec: ./muuk
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: .
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@v6
- name: Set up MSVC (Windows only)
if: matrix.compiler == 'msvc'
uses: ilammy/msvc-dev-cmd@v1
# - name: Install LLVM (macOS only)
# if: runner.os == 'macOS'
# run: |
# brew install llvm
# echo "LLVM installed at: $(brew --prefix llvm)"
# echo "$(brew --prefix llvm)/bin" >> $GITHUB_PATH
- name: Install LLVM
if: runner.os == 'macOS'
run: |
brew install llvm
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
- name: Verify clang-scan-deps
if: runner.os == 'macOS'
run: clang-scan-deps --version
- name: Install LLVM (Linux only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential llvm clang lld
echo "LLVM installed at: $(llvm-config --prefix)"
echo "$(llvm-config --bindir)" >> $GITHUB_PATH
- name: Make binary executable (Linux/macOS only)
if: runner.os != 'Windows'
run: chmod +x muuk
- name: Install dependencies with muuk
run: ${{ matrix.muuk_exec }} install
- name: Create build directory
shell: bash
run: |
mkdir -p build/release
mkdir -p build/debug
- name: Build project
run: ${{ matrix.muuk_exec }} build -c ${{ matrix.compiler }} -p debug
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install pytest
run: pip install pytest
- name: Run test
if: runner.os == 'Windows'
run: pytest test/external/test.py
- name: Run C++ tests (Windows)
if: runner.os == 'Windows'
run: ./build/debug/test.exe
# - name: Run C++ tests (Unix)
# if: runner.os != 'Windows'
# run: ./build/debug/test/test
clang:
name: Compile with Clang on ${{ matrix.os }}
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
artifact_name: muuk-windows
binary_name: muuk.exe
muuk_exec: .\muuk.exe
# - os: macos-latest
# artifact_name: muuk-macos
# binary_name: muuk
# compiler: clang
# muuk_exec: ./muuk
- os: ubuntu-latest
artifact_name: muuk-linux
binary_name: muuk
muuk_exec: ./muuk
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: .
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@v6
- name: Set up MSVC (Windows only)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Install LLVM (Linux only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential llvm clang lld
echo "LLVM installed at: $(llvm-config --prefix)"
echo "$(llvm-config --bindir)" >> $GITHUB_PATH
- name: Make binary executable (Linux/macOS only)
if: runner.os != 'Windows'
run: chmod +x muuk
- name: Install dependencies with muuk
run: ${{ matrix.muuk_exec }} install
- name: Create build directory
shell: bash
run: |
mkdir -p build/release
mkdir -p build/debug
- name: Build project
run: ${{ matrix.muuk_exec }} build -c clang -p debug