From d930becf298fb3b9673f8b2c2b5b104064481b04 Mon Sep 17 00:00:00 2001 From: Kai Zhu Date: Thu, 23 Mar 2023 11:26:21 -0500 Subject: [PATCH] Migrate ci from travis-ci to github-actions. --- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++++++++++++++++ .gitignore | 22 +++---------------- CMakeLists.txt | 15 ++++++++----- ci.sh | 13 ++++++++++++ 4 files changed, 72 insertions(+), 24 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 ci.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..efc40b79 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.gitignore b/.gitignore index d9baa7cf..1d559f3f 100644 --- a/.gitignore +++ b/.gitignore @@ -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 @@ -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 @@ -55,3 +36,6 @@ cascade_train2.net mushroom_float.net robot_float.net scaling.net + +/VS2010/.vs/ +/bin/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 12ea06cd..abc5a647 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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) @@ -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) @@ -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 ################ @@ -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 diff --git a/ci.sh b/ci.sh new file mode 100644 index 00000000..9c9e0929 --- /dev/null +++ b/ci.sh @@ -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 +)