Skip to content

Commit

Permalink
Merge pull request #144 from kaizhu256/pr_migrate_ci_to_github_actions
Browse files Browse the repository at this point in the history
Migrate ci from travis-ci to github-actions.
  • Loading branch information
bukka committed Feb 21, 2024
2 parents 8409b42 + d930bec commit b591110
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 24 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# this workflow will run ci
name: ci
on:
push:
branches:
- alpha
- beta
- master
workflow_dispatch:
env:
zzzz1234: 1
jobs:
job1:
strategy:
matrix:
architecture:
# - arm64
- x64
# - x86
os:
- macos-latest
- ubuntu-latest
# - windows-latest
# base - .github/workflows/ci.yml - beg
env:
CI_MATRIX_NAME: >
${{ matrix.architecture }}
${{ matrix.os }}
CI_WORKFLOW_NAME: >
${{ github.workflow }}
- ${{ github.event_name }}
- ${{ github.event.inputs.workflow_dispatch_name }}
- ${{ github.ref_name }}
name: >
${{ matrix.architecture }}
${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- run: echo "$(date -u +"%Y-%m-%d %TZ") - ${{ env.CI_WORKFLOW_NAME }}" # "
# disable autocrlf in windows
- run: git config --global core.autocrlf false
# https://github.com/actions/checkout
- uses: actions/checkout@v3
# run nodejs coverages and tests
- run: sh ./ci.sh
# base - .github/workflows/ci.yml - end
22 changes: 3 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,6 @@
ipch
Debug
Release
/bin/fanndoubled.dll
/bin/fanndoubled.lib
/bin/fannfixedd.dll
/bin/fannfixedd.lib
/bin/fannfloatd.dll
/bin/fannfloatd.lib
/bin/simple_train_doubled.exe
/bin/simple_train_floatd.exe
/bin/xor_test_fixedd.exe
/bin/xor_test_floatd.exe
/bin/xor_traind.exe
Makefile
CMakeFiles
CMakeCache.txt
Expand All @@ -27,14 +16,6 @@ fann-config.cmake
fann.pc
install_manifest.txt
*~
/bin/cascade_traind.exe
/bin/momentumsd.exe
/bin/mushroomd.exe
/bin/robotd.exe
/bin/scaling_testd.exe
/bin/scaling_traind.exe
/bin/steepness_traind.exe
/bin/xor_cpp_sampled.exe
*.sln
*.suo
*.filters
Expand All @@ -55,3 +36,6 @@ cascade_train2.net
mushroom_float.net
robot_float.net
scaling.net

/VS2010/.vs/
/bin/
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
IF(BIICODE)
# Initializes block variables
INIT_BIICODE_BLOCK()

# Output folder for binaries
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../bin/fann/examples)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/../bin/fann/examples)
Expand All @@ -18,11 +18,11 @@ IF(BIICODE)
LIST(FIND BII_BLOCK_EXES examples_parallel_train examples_present)
SET(examples_present (NOT ${examples_present} EQUAL "-1")) # Depending on examples
IF(${examples_present} AND NOT WIN32 AND NOT APPLE) # Linux doesn't have GetTickCount
LIST(REMOVE_ITEM BII_BLOCK_EXES examples_parallel_train)
LIST(REMOVE_ITEM BII_BLOCK_EXES examples_parallel_train)
ENDIF()

ADD_BIICODE_TARGETS()

IF(${examples_present})
# This example needs CPP11
ACTIVATE_CPP11(lasote_fann_examples_xor_sample)
Expand Down Expand Up @@ -61,6 +61,11 @@ IF(NOT COMPILER_SUPPORTS_CXX11)
message(WARNING "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Tests will not be compiled. To enable tests use a compiler that supports C++11.")
ENDIF()

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# ugly-hack - fix [-Werror,-Wdeprecated-copy] in macos
add_compile_options(-Wno-deprecated)
endif()

list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)

set (FANN_VERSION_MAJOR 2)
Expand All @@ -82,7 +87,7 @@ configure_file (cmake/fann.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/fann.pc @ONLY)

install (FILES ${CMAKE_CURRENT_BINARY_DIR}/fann.pc DESTINATION ${PKGCONFIG_INSTALL_DIR})

ADD_SUBDIRECTORY( src )
ADD_SUBDIRECTORY( src )

################# cpack ################

Expand All @@ -95,7 +100,7 @@ SET(CPACK_PACKAGE_VERSION_MINOR "${FANN_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${FANN_VERSION_PATCH}")
SET(CPACK_GENERATOR "TGZ;ZIP")
SET(CPACK_SOURCE_GENERATOR "TGZ;ZIP")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Steffen Nissen")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Steffen Nissen")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
IF(WIN32 AND NOT UNIX)
# There is a bug in NSI that does not handle full unix paths properly. Make
Expand Down
13 changes: 13 additions & 0 deletions ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
(set -e
# windows
case "$(uname)" in
MINGW*)
# cmd "/C ci.bat"
exit
;;
esac
# linux and darwin
cmake .
make
./tests/fann_tests
)

0 comments on commit b591110

Please sign in to comment.