Skip to content

Commit

Permalink
Added macos build action
Browse files Browse the repository at this point in the history
  • Loading branch information
bkryza committed Jul 13, 2024
1 parent 3b10885 commit d120bd5
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: Linux

on:
push:
Expand All @@ -8,6 +8,8 @@ on:
- 'util/**'
- 'uml/**'
- '**.md'
- '**.svg'
- '**.png'
branches-ignore:
- 'noactions/*'
pull_request:
Expand All @@ -30,6 +32,8 @@ jobs:
uses: actions/checkout@v4
- name: Update package database
run: sudo apt -y update
- name: ccache
uses: hendrikmuhs/[email protected]
- name: Install deps
run: sudo apt -y install git make pkg-config gcc-11 g++-11 ccache cmake libyaml-cpp-dev llvm-15 clang-15 libclang-15-dev libclang-cpp15-dev clang-format-15 lcov zlib1g-dev libunwind-dev libdw-dev
- name: Select g++ version
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: macOS

on:
push:
paths-ignore:
- 'docs/**'
- 'packaging/**'
- 'util/**'
- 'uml/**'
- '**.md'
- '**.svg'
- '**.png'
branches-ignore:
- 'noactions/*'
pull_request:
paths-ignore:
- 'docs/**'
- 'packaging/**'
- 'util/**'
- 'uml/**'
- '**.md'
- '**.svg'
- '**.png'
branches-ignore:
- 'noactions/*'

jobs:
build-macos:
name: Build and test on macos
runs-on: macos-14

steps:
- name: Checkout
uses: actions/checkout@v4

- name: ccache
uses: hendrikmuhs/[email protected]

- name: Install dependencies using homebrew
run: brew install llvm@18 ninja yaml-cpp cmake ccache

- name: Build and test
run: CC=/opt/homebrew/opt/llvm/bin/clang CXX=/opt/homebrew/opt/llvm/bin/clang++ CMAKE_PREFIX=/opt/homebrew/opt/llvm/lib/cmake/llvm/ CMAKE_GENERATOR=Ninja CMAKE_EXE_LINKER_FLAGS="-L/opt/homebrew/opt/llvm/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++" make test

- name: Print build version
run: debug/src/clang-uml --version

- name: Print help
run: debug/src/clang-uml --help
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# C++ UML diagram generator based on Clang

[![Build status](https://github.com/bkryza/clang-uml/actions/workflows/build.yml/badge.svg)](https://github.com/bkryza/clang-uml/actions)
[![Linux build status](https://github.com/bkryza/clang-uml/actions/workflows/build.yml/badge.svg)](https://github.com/bkryza/clang-uml/actions)
[![macos build status](https://github.com/bkryza/clang-uml/actions/workflows/macos.yml/badge.svg)](https://github.com/bkryza/clang-uml/actions)
[![Coverage](https://codecov.io/gh/bkryza/clang-uml/branch/master/graph/badge.svg)](https://codecov.io/gh/bkryza/clang-uml)
[![Version](https://img.shields.io/badge/version-0.5.3-blue)](https://github.com/bkryza/clang-uml/releases)
[![Version](https://img.shields.io/badge/LLVM-12,13,14,15,16,17,18-orange)](https://github.com/bkryza/clang-uml/releases)
Expand Down
14 changes: 13 additions & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ make install DESTDIR=/opt/clang-uml
export PATH=$PATH:$PWD/release
```

#### macos
#### macOS

On Intel-based macOS:
```bash
brew install ccache cmake llvm yaml-cpp

Expand All @@ -134,6 +135,17 @@ LLVM_VERSION=16 make release
CMAKE_PREFIX=/usr/local/opt/llvm/lib/cmake/llvm make release
```

On Arm-based macOS:
```bash
brew install ccache cmake llvm yaml-cpp

export CC=/opt/homebrew/opt/llvm/bin/clang
export CXX=/opt/homebrew/opt/llvm/bin/clang++
CMAKE_PREFIX=/usr/local/opt/llvm/lib/cmake/llvm CMAKE_EXE_LINKER_FLAGS="-L/opt/homebrew/opt/llvm/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++" make release
```
> These paths will use the latest LLVM version installed by `brew`.
> If you want to use a specific version, you will need to adjust the paths.
#### Windows

##### Visual Studio native build
Expand Down

0 comments on commit d120bd5

Please sign in to comment.