Skip to content

Commit

Permalink
Build and test a macos-amd64 version of dynamips with a github workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviojs committed Oct 6, 2024
1 parent 4623264 commit bff56dd
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,53 @@ jobs:
name: linux-x86-failure
path: ${{github.workspace}}/build/
compression-level: 9 # maximum compression

# ----------------------------------------------------------------------------------------------
macos-amd64:
name: MacOS (amd64/x86_64)
runs-on: macos-13 # macos-13 is the last runner with an AMD64 cpu, macos-14 has an ARM cpu (Apple M1)
steps:
- uses: actions/checkout@v4

- name: Install dependencies with brew
uses: ConorMacBride/install-package@v1
with:
brew: libelf # libpcap is included in the SDK

- name: Configure with CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DDYNAMIPS_CODE=both -DBUILD_UDP_RECV=ON -DBUILD_UDP_SEND=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install -DCPACK_PACKAGE_FILE_NAME=dynamips-package -DCPACK_GENERATOR=ZIP

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
run: |
set -x
cd ${{github.workspace}}/build
ctest --verbose --build-config ${{env.BUILD_TYPE}}
./stable/dynamips -e
./unstable/dynamips_amd64_unstable -e
- name: Install
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install

- name: Package
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target package

- name: Upload success
if: ${{ success() }}
uses: actions/upload-artifact@v4
with:
name: macos-amd64-success
path: |
${{github.workspace}}/build/install/
${{github.workspace}}/build/dynamips-package.zip
compression-level: 9 # maximum compression

- name: Upload failure
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: macos-amd64-failure
path: ${{github.workspace}}/build/
compression-level: 9 # maximum compression
2 changes: 1 addition & 1 deletion cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

message ( STATUS "dependencies - BEGIN" )

if ( "${CMAKE_C_COMPILER}" MATCHES "clang$" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" )
if ( "${CMAKE_C_COMPILER}" MATCHES "clang$" OR "${CMAKE_C_COMPILER_ID}" MATCHES "Clang$" )
set ( CMAKE_COMPILER_IS_CLANG 1 )
endif()

Expand Down

0 comments on commit bff56dd

Please sign in to comment.