thomasmoelhave / tpie

Templated Portable I/O Environment
Other
112 stars 24 forks source link

Move Continuous Integration to GitHub Actions #247

Closed SSoelvsten closed 2 years ago

SSoelvsten commented 3 years ago

Closes #246

Except for the more important changes below, I also took the liberty to update the README.md with new badges and some basic information. The latter hopefully makes for a better first impression for anyone stumbling upon the repository page.

GitHub Action: Unit Tests

Recreates the Travis CI unit tests on Ubuntu and MacOS. The job runs on all pushes or pull requests to the master branch. Furthermore, they are only run if anything has been changed in the tpie/ and/or the test/ folder. The job installs all dependencies (compiler of choice, Boost, Snappy, LZ4, ZSTD), runs CMake and the compiler, then CTest to run all tests, and finally the scripts/check_missing_ctests.py script to verify no tests were missed.

All unit tests are run based on a matrix with the following combinations.

TODO

GitHub Action: Documentation

Adds a job to compile the entire documentation on changes to the tpie/ and/or the doc/ folder.

Furthermore, I have fixed some issues with the documentation.

SSoelvsten commented 3 years ago

I got to the point where, while it still should be considered WIP, I need feedback as per the feature requirements.

Mortal commented 3 years ago

I also tried to recreate the build and unit testing on Windows, but I end up with the same error messages as on Travis CI.

Do you still have the configuration you tried out? The error message in Travis CI appears on Stack Overflow so I wonder if we can get it working by fiddling with the right flags.

SSoelvsten commented 3 years ago

Thanks for the link to Stack Overflow, I think there are some settings that are missing on CMake or MSBuild. I'll look further into it and let you know.

Here is the minimal example of just trying to build on Windows. Based on the Stack Overflow you linked, I thought it would have been related to Boost, but the version I was installing is 1.74.0

name: build (windows)

on: [push]

jobs:
  build:
    name: 'Build (Windows, ${{matrix.build_type}})'
    runs-on: ${{ matrix.os }}

    strategy:
      fail-fast: false
      matrix:
        os: [windows-latest]
        build_type: [Release] #, Debug, ExtraDebug]

    steps:
    # Git repo set up
    - name: Checkout commit
      uses: actions/checkout@v2

    # Install dependencies
    - name: Add msbuild to PATH
      uses: microsoft/setup-msbuild@v1.0.2

    - name: Install dependencies
      run: |
        echo "================================"
        echo "Boost"
        choco install boost-msvc-14.2

    - name: CMake build
      working-directory: ${{runner.workspace}}
      run: |
        cmake -E make_directory ${{github.workspace}}/build
        cd ${{github.workspace}}/build
        SET CXXFLAGS="%CXXFLAGS% -D_HAS_AUTO_PTR_ETC=1"
        cmake -G "Visual Studio 16 2019" -A x64 -D CMAKE_BUILD_TYPE="${{matrix.build_type}}" -D CMAKE_CXX_STANDARD=17 ..

        msbuild ALL_BUILD.vcxproj

EDIT: Update to latest attempt

SSoelvsten commented 3 years ago

After setting CXXFLAGS with _HAS_AUTO_PTR_ETC=1 quite a few of the C++14 deprecations are dealt with. I have updated the comment above with a newer version of the script. But, there are still two problems left.

Based on what I can read this may be a sign that my _HAS_AUTO_PTR_ETC flag may not truly work? I tried to set it with CMAKE_CXX_FLAGS instead, but that just broke completely...

Otherwise there seems not to be any errors in the output. Whether more will show up when the above is fixed, I of course cannot guarantee.

SSoelvsten commented 2 years ago

I fixed the mistake of writing that TPIE was under the GPL v3 license rather than the LGPL v3 license.

With regards to the Windows build: Do we know whether TPIE actually does work with Microsoft's compiler out-of-the-box? If not, maybe I should just add the Windows action that fails and then maybe investigate getting a Windows build to work inside of another pull request.

EDIT: I just saw that @antialize pushed commit a1c260d431d4125db1eba6edf46c1a0cf135274e that might fix Microsoft's compiler from failing. I'll try once more doing this when that one has been merged into master.

SSoelvsten commented 2 years ago

I have rebased this pull request on master and added the Windows Build as requested. But still, note that it throws the same errors as with Travis. To fix this, someone needs to tell me what CMake or VSCode configuration to use. If so, then I'll move the build_windows.yml action into the test.yml. Alternatively, I can also have a test_linux.yml, test_macos.yml, and test_windows.yml assuming you are not too worried about some code duplication.

Still, this is a huge improvement on the current status of CI not working at all.

SSoelvsten commented 2 years ago

The Mac OS builds are failing because std::random_shuffle do not exist in the standard library. This is to be expected since it was deprecated with the 14-standard and removed in the 17-standard - yet the CMake configuration in tpie/CMakeLists.txt is set to 17.

Mortal commented 2 years ago

Thanks @SSoelvsten ! As you noted, @antialize frequently works on getting TPIE to build on Windows, so he probably knows what CMake settings work/don't work on Windows.

SSoelvsten commented 2 years ago

This is how to host the newest documentation on GitHub pages

image