diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml new file mode 100644 index 00000000..44477667 --- /dev/null +++ b/.github/workflows/build-macos.yml @@ -0,0 +1,21 @@ +name: build-macos + +on: [push, pull_request] + +jobs: + + macos: + timeout-minutes: 60 + runs-on: macOS-latest + + strategy: + matrix: + mode: [-DBUILD_UVW_SHARED_LIB=ON, -DBUILD_UVW_LIBS=ON, -DBUILD_UVW_LIBS=OFF] + + steps: + - uses: actions/checkout@v1 + - name: Compile tests + working-directory: build + run: | + cmake ${{ matrix.mode }} -DBUILD_TESTING=ON -Dlibuv_buildtests=OFF .. + make -j2 diff --git a/.github/workflows/build-ubuntu-20.04.yml b/.github/workflows/build-ubuntu-20.04.yml new file mode 100644 index 00000000..1dff35a1 --- /dev/null +++ b/.github/workflows/build-ubuntu-20.04.yml @@ -0,0 +1,40 @@ +name: build-ubuntu-20.04 + +on: [push, pull_request] + +jobs: + + linux: + timeout-minutes: 60 + strategy: + matrix: + compiler: + - { pkg: g++, exe: 'g++', version: 7 } + - { pkg: g++, exe: 'g++', version: 8 } + - { pkg: g++, exe: 'g++', version: 9 } + - { pkg: clang, exe: 'clang++', version: 8 } + - { pkg: clang, exe: 'clang++', version: 9 } + - { pkg: clang, exe: 'clang++', version: 10 } + - { pkg: clang, exe: 'clang++', version: 11 } + mode: [-DBUILD_UVW_SHARED_LIB=ON, -DBUILD_UVW_LIBS=ON, -DBUILD_UVW_LIBS=OFF] + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + - name: Install ${{ matrix.compiler.exe }} + run: | + sudo apt-get update --fix-missing + sudo apt install -y ${{ matrix.compiler.pkg }}-${{ matrix.compiler.version }} + - name: Compile tests + working-directory: build + env: + CXX: ${{ matrix.compiler.exe }}-${{ matrix.compiler.version }} + run: | + cmake ${{ matrix.mode }} -DBUILD_TESTING=ON -Dlibuv_buildtests=OFF .. + make -j2 + - name: Run tests + working-directory: build + env: + CTEST_OUTPUT_ON_FAILURE: 1 + run: ctest --timeout 5 -C Debug -j2 diff --git a/.github/workflows/build-ubuntu-latest.yml b/.github/workflows/build-ubuntu-latest.yml new file mode 100644 index 00000000..e8408283 --- /dev/null +++ b/.github/workflows/build-ubuntu-latest.yml @@ -0,0 +1,39 @@ +name: build-ubuntu-latest + +on: [push, pull_request] + +jobs: + + linux: + timeout-minutes: 60 + strategy: + matrix: + compiler: + - { pkg: g++, exe: 'g++', version: 10 } + - { pkg: g++, exe: 'g++', version: 11 } + - { pkg: g++, exe: 'g++', version: 12 } + - { pkg: clang, exe: 'clang++', version: 12 } + - { pkg: clang, exe: 'clang++', version: 13 } + - { pkg: clang, exe: 'clang++', version: 14 } + mode: [-DBUILD_UVW_SHARED_LIB=ON, -DBUILD_UVW_LIBS=ON, -DBUILD_UVW_LIBS=OFF] + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Install ${{ matrix.compiler.exe }} + run: | + sudo apt-get update --fix-missing + sudo apt install -y ${{ matrix.compiler.pkg }}-${{ matrix.compiler.version }} + - name: Compile tests + working-directory: build + env: + CXX: ${{ matrix.compiler.exe }}-${{ matrix.compiler.version }} + run: | + cmake ${{ matrix.mode }} -DBUILD_TESTING=ON -Dlibuv_buildtests=OFF .. + make -j2 + - name: Run tests + working-directory: build + env: + CTEST_OUTPUT_ON_FAILURE: 1 + run: ctest --timeout 5 -C Debug -j2 diff --git a/.github/workflows/build-win.yml b/.github/workflows/build-win.yml new file mode 100644 index 00000000..e2419f17 --- /dev/null +++ b/.github/workflows/build-win.yml @@ -0,0 +1,22 @@ +name: build-win + +on: [push, pull_request] + +jobs: + + windows: + timeout-minutes: 60 + runs-on: windows-latest + + strategy: + matrix: + generator: [Visual Studio 17 2022] + mode: [-DBUILD_UVW_SHARED_LIB=ON, -DBUILD_UVW_LIBS=ON, -DBUILD_UVW_LIBS=OFF] + + steps: + - uses: actions/checkout@v1 + - name: Compile tests + working-directory: build + run: | + cmake -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE ${{ matrix.mode }} -DBUILD_TESTING=ON -Dlibuv_buildtests=OFF -DCMAKE_CXX_FLAGS=/W1 -G"${{ matrix.generator }}" .. + cmake --build . -j 2 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index d432a213..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,90 +0,0 @@ -name: build - -on: [push, pull_request] - -jobs: - - linux: - timeout-minutes: 60 - runs-on: ubuntu-latest - - strategy: - matrix: - compiler: [ - g++-7, g++-8, g++-9, g++, - clang++-8, clang++-9, clang++-10, clang++ - ] - mode: [-DBUILD_UVW_SHARED_LIB=ON, -DBUILD_UVW_LIBS=ON, -DBUILD_UVW_LIBS=OFF] - - steps: - - uses: actions/checkout@v2 - - name: Install g++-7 - if: ${{ matrix.compiler == 'g++-7' }} - run: | - sudo apt-get update - sudo apt-get install g++-7 -y - - name: Install g++-8 - if: ${{ matrix.compiler == 'g++-8' }} - run: | - sudo apt-get update - sudo apt-get install g++-8 -y - - name: Install clang-8 - if: ${{ matrix.compiler == 'clang++-8' }} - run: | - sudo apt-get update - sudo apt-get install clang-8 -y - - name: Install clang-9 - if: ${{ matrix.compiler == 'clang++-9' }} - run: | - sudo apt-get update - sudo apt-get install clang-9 -y - - name: Install clang-10 - if: ${{ matrix.compiler == 'clang++-10' }} - run: | - sudo apt-get update - sudo apt-get install clang-10 -y - - name: Compile tests - working-directory: build - env: - CXX: ${{ matrix.compiler }} - run: | - cmake ${{ matrix.mode }} -DBUILD_TESTING=ON -Dlibuv_buildtests=OFF .. - make -j2 - - name: Run tests - working-directory: build - env: - CTEST_OUTPUT_ON_FAILURE: 1 - run: ctest --timeout 5 -C Debug -j2 - - windows: - timeout-minutes: 60 - runs-on: windows-latest - - strategy: - matrix: - generator: [Visual Studio 17 2022] - mode: [-DBUILD_UVW_SHARED_LIB=ON, -DBUILD_UVW_LIBS=ON, -DBUILD_UVW_LIBS=OFF] - - steps: - - uses: actions/checkout@v1 - - name: Compile tests - working-directory: build - run: | - cmake -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE ${{ matrix.mode }} -DBUILD_TESTING=ON -Dlibuv_buildtests=OFF -DCMAKE_CXX_FLAGS=/W1 -G"${{ matrix.generator }}" .. - cmake --build . -j 2 - - macos: - timeout-minutes: 60 - runs-on: macOS-latest - - strategy: - matrix: - mode: [-DBUILD_UVW_SHARED_LIB=ON, -DBUILD_UVW_LIBS=ON, -DBUILD_UVW_LIBS=OFF] - - steps: - - uses: actions/checkout@v1 - - name: Compile tests - working-directory: build - run: | - cmake ${{ matrix.mode }} -DBUILD_TESTING=ON -Dlibuv_buildtests=OFF .. - make -j2 diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d9982a9..d4ac08b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -237,7 +237,10 @@ endif() add_custom_target( uvw_aob SOURCES - .github/workflows/build.yml + .github/workflows/build-macos.yml + .github/workflows/build-ubuntu-20.04.yml + .github/workflows/build-ubuntu-latest.yml + .github/workflows/build-win.yml .github/workflows/coverage.yml .github/workflows/deploy.yml .github/FUNDING.yml