Skip to content

Commit

Permalink
macos github
Browse files Browse the repository at this point in the history
  • Loading branch information
luan committed Oct 10, 2023
1 parent c22722a commit 1d96d39
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
name: Build - macOS

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "src/**"
- "source/**"
- "cmake/**"
- "CMakeLists.txt"
- "CMakePresets.json"
- "vcpkg.json"
push:
paths:
- "src/**"
- "source/**"
- "cmake/**"
- "CMakeLists.txt"
- "CMakePresets.json"
- "vcpkg.json"
branches:
- main

env:
CMAKE_BUILD_PARALLEL_LEVEL: 2
MAKEFLAGS: "-j 2"

jobs:
job:
if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
name: ${{ matrix.os }}-${{ matrix.buildtype }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [macos-latest]
buildtype: [linux-release]
include:
- os: macos-latest
triplet: arm-osx

steps:
- name: Cancel Previous Runs
if: github.ref != 'refs/heads/main'
uses: fkirc/skip-duplicate-actions@master
with:
concurrent_skipping: "same_content"
cancel_others: true

- name: Checkout repository
uses: actions/checkout@main

- name: Install macOS Dependencies
run: >
brew update && brew install ccache ninja
- name: CCache
uses: hendrikmuhs/ccache-action@main
with:
max-size: "1G"
key: ccache-${{ matrix.os }}-${{ matrix.buildtype }}
restore-keys: |
ccache-${{ matrix.os }}
- name: Restore artifacts and install vcpkg
id: vcpkg-step
run: |
vcpkgCommitId=$(grep '.builtin-baseline' vcpkg.json | awk -F: '{print $2}' | tr -d '," ')
echo "vcpkg commit ID: $vcpkgCommitId"
echo "VCPKG_GIT_COMMIT_ID=$vcpkgCommitId" >> $GITHUB_ENV
- name: Get vcpkg commit id from vcpkg.json
uses: lukka/run-vcpkg@main
with:
vcpkgGitURL: "https://github.com/microsoft/vcpkg.git"
vcpkgGitCommitId: ${{ env.VCPKG_GIT_COMMIT_ID }}

- name: Get latest CMake and ninja
uses: lukka/get-cmake@main

# - name: Install additional libraries
# run: sudo apt-get install libasio-dev nlohmann-json3-dev libfmt-dev libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev libglib2.0-dev at-spi2-core libwxgtk3.0-gtk3-dev libarchive-dev freeglut3-dev libxmu-dev libdbus-1-dev libxtst-dev

- name: Run CMake Cache and Build
uses: lukka/run-cmake@main
with:
configurePreset: ${{ matrix.buildtype }}
buildPreset: ${{ matrix.buildtype }}

- name: Upload artifacts
uses: actions/upload-artifact@main
with:
name: ${{ matrix.os }}-${{ matrix.buildtype }}
path: |
${{ github.workspace }}/remeres

0 comments on commit 1d96d39

Please sign in to comment.