Skip to content

Move Continuous Integration to GitHub Actions#247

Merged
Mortal merged 11 commits intothomasmoelhave:masterfrom
ssoelvsten:fix-ci
May 23, 2022
Merged

Move Continuous Integration to GitHub Actions#247
Mortal merged 11 commits intothomasmoelhave:masterfrom
ssoelvsten:fix-ci

Conversation

@ssoelvsten
Copy link
Copy Markdown
Contributor

@ssoelvsten ssoelvsten commented Jun 8, 2021

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.

  • Ubuntu (Latest, i.e. 20.04)

    • Compilers: GNU 7, 9 and 10, Clang 7 and 11
    • Build Type: Release (but can be set for Debug and ExtraDebug easily?)
  • MacOS (Latest)

    • Compilers: GNU 7 and 10 and Clang with XCode 10, 11, and 12
    • Build Type: Release (but can be set for Debug and ExtraDebug easily?)

TODO

  • Remove Travis CI files:
    • scripts/generate_travis.py
    • scripts/travis_header.yml
    • .travis.yml
    • appveyor.yml
  • I have witnessed a few times today (2021-06-08) that the unit test 144 - merge_sort_small_final_fanout fails due to a timeout. This happens primarily on the MacOS machines.
  • 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.

GitHub Action: Documentation

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

  • If it is a pull request to master, then the result is output in a downloadable .zip file artifact.
  • If it is a push to master, then the result is pushed to the gh-pages branch such that the newest documentation is automatically hosted at thomasmoelhave.github.io/tpie (after having set it to be hosted in the settings. For an example, see ssoelvsten.github.io/tpie).

Furthermore, I have fixed some issues with the documentation.

  • The navigation tree crashes on initial load, since navtreedata.js was not loaded in the header
  • TeXLive seems to crash when processing _formulas, so MathJX is used to compile the formulas at runtime. Really, this does not "fix" the problem, but it ensures that the entire compilation process finishes.

@ssoelvsten
Copy link
Copy Markdown
Contributor Author

ssoelvsten commented Jun 8, 2021

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

@Mortal
Copy link
Copy Markdown
Collaborator

Mortal commented Jun 8, 2021

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
Copy link
Copy Markdown
Contributor Author

ssoelvsten commented Jun 9, 2021

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 ssoelvsten changed the title Move Continuous Integration to GitHub pages Move Continuous Integration to GitHub Actions Jun 10, 2021
@ssoelvsten
Copy link
Copy Markdown
Contributor Author

ssoelvsten commented Aug 6, 2021

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.

  • random_shuffle does not exist anymore in std.
  • std::binary_function is removed and so one gets the C2143: syntax error: missing ',' before '<' error in test/unit/common.h due to error C2504: 'binary_function': base class undefined .

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 ssoelvsten force-pushed the fix-ci branch 2 times, most recently from 5a3c15b to f9c25df Compare December 18, 2021 09:34
@ssoelvsten
Copy link
Copy Markdown
Contributor Author

ssoelvsten commented Dec 18, 2021

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 a1c260d that might fix Microsoft's compiler from failing. I'll try once more doing this when that one has been merged into master.

@ssoelvsten
Copy link
Copy Markdown
Contributor Author

ssoelvsten commented May 23, 2022

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
Copy link
Copy Markdown
Contributor Author

ssoelvsten commented May 23, 2022

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 Mortal merged commit 4739728 into thomasmoelhave:master May 23, 2022
@Mortal
Copy link
Copy Markdown
Collaborator

Mortal commented May 23, 2022

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
Copy link
Copy Markdown
Contributor Author

ssoelvsten commented May 24, 2022

This is how to host the newest documentation on GitHub pages

image

@ssoelvsten ssoelvsten deleted the fix-ci branch June 3, 2022 13:21
@ssoelvsten ssoelvsten mentioned this pull request Jun 4, 2022
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Get CI back up to speed

2 participants