diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml new file mode 100644 index 0000000..98c3254 --- /dev/null +++ b/.github/workflows/continuous-integration.yaml @@ -0,0 +1,78 @@ +name: Build and run tests + +on: + - push + - pull_request + +jobs: + build: + name: ${{ matrix.config.name }} + runs-on: ${{ matrix.config.os }} + strategy: + fail-fast: false + matrix: + config: + - name: "Windows Latest - MSVC" + os: windows-latest + cc: "cl" + cxx: "cl" + cmake: cmake + test: false + + - name: "Ubuntu Latest - GCC" + os: ubuntu-latest + cc: "gcc-9" + cxx: "g++-9" + cmake: "cmake" + test: true + + - name: "Ubuntu Latest - Clang" + os: ubuntu-latest + cc: "clang-9" + cxx: "clang++-9" + cmake: "cmake" + test: true + + - name: "Ubuntu Latest - Emscripten" + os: ubuntu-latest + cc: "emcc" + cxx: "em++" + cmake: "emcmake cmake" + test: false + + - name: "macOS Latest Clang" + os: macos-latest + artifact: "macos_clang.7z" + build_type: "Release" + cc: "clang" + cxx: "clang++" + cmake: cmake + test: true + + steps: + - uses: actions/checkout@v2 + - uses: seanmiddleditch/gha-setup-ninja@master + + - name: Set Windows ENV + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + + - name: Setup Emscripten + if: ${{ matrix.config.cc == 'emcc' }} + uses: mymindstorm/setup-emsdk@v7 + + - name: Build + run: > + mkdir build; + cd build; + ${{ matrix.config.cmake }} + .. + -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} + -DFTXUI_BUILD_TESTS=ON; + cmake --build . --config Release; + + - name: Tests + if: ${{ matrix.config.test }} + run: > + cd build; + ./tests diff --git a/src/ftxui/component/screen_interactive.cpp b/src/ftxui/component/screen_interactive.cpp index 4c486bf..130ce34 100644 --- a/src/ftxui/component/screen_interactive.cpp +++ b/src/ftxui/component/screen_interactive.cpp @@ -92,6 +92,8 @@ void EventListener(std::atomic* quit, #else +#include + int CheckStdinReady(int usec_timeout) { timeval tv = {0, usec_timeout}; fd_set fds;