Skip to content

Commit

Permalink
Merge pull request #9 from dsm/develop
Browse files Browse the repository at this point in the history
added macos intel ci and improve other ci
  • Loading branch information
ra3xdh authored Jul 3, 2024
2 parents c484c7a + 4cf59a6 commit 618aaf0
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 48 deletions.
61 changes: 37 additions & 24 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,61 @@ on:
branches: [ "develop", "release/*" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
jobs:
build-mac-intel:
runs-on: macos-12

steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable

- uses: actions/checkout@v4

- name: Install dependencies
shell: bash
run: |
brew install gperf dos2unix bison flex ninja
echo 'export PATH="$(brew --prefix bison)/bin:$PATH"' >> /Users/runner/.bashrc
export LDFLAGS="-L$(brew --prefix bison)/lib"
source ~/.bashrc
brew link bison --force

build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build -G 'Ninja' -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: |
cmake --build ${{github.workspace}}/build --parallel --config ${{env.BUILD_TYPE}}
build-mac-arm:
runs-on: macos-latest

steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
xcode-version: latest-stable

- uses: actions/checkout@v4

- name: InstallDependencies
- name: Install dependencies
shell: bash
run: |
brew install gperf dos2unix bison flex
echo 'export PATH="/opt/homebrew/opt/bison/bin:$PATH"' >> /Users/runner/.bashrc
export LDFLAGS="-L/opt/homebrew/opt/bison/lib"
brew install gperf dos2unix bison flex ninja
echo 'export PATH="$(brew --prefix bison)/bin:$PATH"' >> /Users/runner/.bashrc
export LDFLAGS="-L$(brew --prefix bison)/lib"
source ~/.bashrc
brew link bison --force
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -G 'Unix Makefiles' -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
run: |
cmake -B ${{github.workspace}}/build -G 'Ninja' -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build -j16 --config ${{env.BUILD_TYPE}}

#- name: Test
# working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
# run: ctest -C ${{env.BUILD_TYPE}}

run: |
cmake --build ${{github.workspace}}/build --parallel --config ${{env.BUILD_TYPE}}
40 changes: 21 additions & 19 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,45 @@ env:
jobs:
build:
runs-on: windows-latest

strategy:
fail-fast: false
matrix:
sys:
- mingw64
- clang64
- ucrt64
defaults:
run:
shell: msys2 {0}

steps:
- name: Disable autocrlf
shell: pwsh
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
msys2-root: ${{ runner.workspace }}/msys2
msystem: UCRT64
msystem: ${{ matrix.sys }}
cache: true
update: true
install: >-
git
mingw-w64-ucrt-x86_64-cmake
mingw-w64-ucrt-x86_64-gcc
mingw-w64-ucrt-x86_64-qt6-base
mingw-w64-ucrt-x86_64-qt6-tools
mingw-w64-ucrt-x86_64-qt6-svg
mingw-w64-ucrt-x86_64-make
mingw-w64-ucrt-x86_64-ninja
mingw-w64-ucrt-x86_64-python
bison
flex
flex
dos2unix
mingw-w64-ucrt-x86_64-gperf
pacboy: >-
cmake:p
gcc:p
make:p
python:p
gperf:p
- name: Build with cmake
run: |
ls -la
cmake.exe -B build/ -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
cmake.exe --build build/ -j`nproc` --config ${{env.BUILD_TYPE}}
19 changes: 14 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,20 @@ if(WIN32)
find_package(BISON 2.4 REQUIRED)
else() # Linux, OSX
if(APPLE)
find_package(
BISON 3.0.0 REQUIRED
# homebrew_bison
PATH "/opt/homebrew/opt/bison/bin/"
find_program(BISON_EXECUTABLE bison
PATHS
"/opt/homebrew/opt/bison/bin/"
"/usr/local/opt/bison/bin/"
NO_DEFAULT_PATH
)

if(NOT BISON_EXECUTABLE)
message(FATAL_ERROR "Bison 3.0.0 executable not found")
else()
message(STATUS "Bison found: ${BISON_EXECUTABLE}")
set(BISON_EXECUTABLE ${BISON_EXECUTABLE} CACHE FILEPATH "Path to Bison executable")
endif()
find_package(BISON 3.0.0 REQUIRED)
else(APPLE)
# use -DBISON_DIR=/path/ to provide the path to bison
find_program(
Expand Down Expand Up @@ -329,4 +338,4 @@ set(CPACK_GENERATOR "TGZ")
# (InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_VERSION_MAJOR 0)
set(CPACK_PACKAGE_VERSION_MINOR 18)
include(CPack)
include(CPack)

0 comments on commit 618aaf0

Please sign in to comment.