Add CI on github action. (#76)

This commit is contained in:
Arthur Sonzogni 2021-03-20 22:45:21 +01:00 committed by GitHub
parent af4bf379bc
commit a6a7f0a354
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 80 additions and 0 deletions

View File

@ -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

View File

@ -92,6 +92,8 @@ void EventListener(std::atomic<bool>* quit,
#else #else
#include <sys/time.h>
int CheckStdinReady(int usec_timeout) { int CheckStdinReady(int usec_timeout) {
timeval tv = {0, usec_timeout}; timeval tv = {0, usec_timeout};
fd_set fds; fd_set fds;