diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3645053 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: ci +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + name: ${{ matrix.config.name }} + runs-on: ${{ matrix.config.os }} + strategy: + fail-fast: false + + matrix: + config: + # FIXME: Windows fails to build EAMain: Error C2664 + # - { name: "Windows MSVC", os: windows-2019, cc: "cl", cxx: "cl", generator: "Visual Studio 16 2019"} + - { name: "Ubuntu gcc", os: ubuntu-22.04, cc: "gcc", cxx: "g++", generator: "Unix Makefiles" } + - { name: "MacOS clang", os: macos-12, cc: "clang", cxx: "clang++", generator: "Unix Makefiles" } + + include: + - build_type: Release + - build_tests: ON + - install_prefix: install + - build_type: Release + + steps: + - uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 1 + + - name: Configure CMake + run: cmake -S . -B ${{github.workspace}}/build -G "${{matrix.config.generator}}" -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -DEABASE_BUILD_TESTS:STRING=${{matrix.build_tests}} -DCMAKE_INSTALL_PREFIX:STRING=${{github.workspace}}/${{matrix.install_prefix}} -DCMAKE_CXX_COMPILER:STRING=${{matrix.config.cxx}} -DCMAKE_C_COMPILER:STRING=${{matrix.config.cc}} + + - name: Build + + run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} + + - name: Test + working-directory: ${{github.workspace}}/build + run: test/EABaseTest + + - name: Install + run: cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} --target install diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1e4a16e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,68 +0,0 @@ -language: cpp - -os: - - linux - - osx - - windows - -compiler: - - gcc - - clang - - msvc - -env: - - EA_CONFIG=Debug - - EA_CONFIG=Release - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - - george-edison55-precise-backports - - llvm-toolchain-trusty-7 - packages: - - cmake - - cmake-data - - g++-7 - - clang-7 - -matrix: - exclude: - - os: osx - compiler: gcc - - os: osx - compiler: msvc - - os: linux - compiler: msvc - - os: windows - compiler: clang - - os: windows - compiler: gcc - -# Handle git submodules yourself -git: - submodules: false - -# Use sed to replace the SSH URL with the public URL, then initialize submodules -before_install: - - sed --version >/dev/null 2>&1 && sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules || sed -i "" 's/git@github.com:/https:\/\/github.com\//' .gitmodules - - git submodule update --init - -install: - - if [[ "$CXX" == "g++" ]]; then export CC="gcc-7" ;fi - - if [[ "$CXX" == "g++" ]]; then export CXX="g++-7" ;fi - - if [[ "$CXX" == "clang++" && "${TRAVIS_OS_NAME}" != "osx" ]]; then export CC="clang-7" ;fi - - if [[ "$CXX" == "clang++" && "${TRAVIS_OS_NAME}" != "osx" ]]; then export CXX="clang++-7" ;fi - -# Universal Setup -before_script: - - mkdir build_$EA_CONFIG - - cd build_$EA_CONFIG - - cmake .. -DEABASE_BUILD_TESTS:BOOL=ON - - cmake --build . --config $EA_CONFIG - -script: - # Run Tests - - cd $TRAVIS_BUILD_DIR/build_$EA_CONFIG/test - - ctest -C $EA_CONFIG -V || exit 1 -