From 8bf39cf1f4106928dcfc4c8bb436e6164ef189c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Mon, 7 Jun 2021 22:21:23 +0200 Subject: [PATCH] Migrate from Travis CI to GitHub Actions The old Travis CI .org service has been throttled for a while now and is said to be shutting down completely next week. This migrates the Travis CI build jobs to GitHub Actions, with minor changes. - The trailing whitespace detection has been removed for now. - The libegl1-mesa-dev dependency for Wayland has been removed as it appears to no longer be necessary for building. (cherry picked from commit 5a6001a83be1c788e7795d891b6a9dd5931e460e) --- .github/workflows/build.yml | 91 ++++++++++++++++++++++++++++ .travis.yml | 114 ------------------------------------ README.md | 2 +- 3 files changed, 92 insertions(+), 115 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..74b28e4a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,91 @@ +name: Build +on: + pull_request: + push: + branches: [ ci, master, 3.3-stable ] +permissions: + statuses: write + contents: read +env: + CC: clang + CFLAGS: -Werror + +jobs: + build-linux-x11-clang: + name: X11 (Linux, Clang) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + sudo apt update + sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev + + - name: Configure static library + run: cmake -S . -B build-static + - name: Build static library + run: cmake --build build-static --parallel + + - name: Configure shared library + run: cmake -S . -B build-shared -D BUILD_SHARED_LIBS=ON + - name: Build shared library + run: cmake --build build-shared --parallel + + build-linux-wayland-clang: + name: Wayland (Linux, Clang) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + sudo apt update + sudo apt install wayland-protocols libwayland-dev libxkbcommon-dev + + - name: Configure static library + run: cmake -S . -B build-static -D GLFW_USE_WAYLAND=ON + - name: Build static library + run: cmake --build build-static --parallel + + - name: Configure shared library + run: cmake -S . -B build-shared -D GLFW_USE_WAYLAND=ON -D BUILD_SHARED_LIBS=ON + - name: Build shared library + run: cmake --build build-shared --parallel + + build-linux-null-clang: + name: Null (Linux, Clang) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + sudo apt update + sudo apt install libosmesa6-dev + + - name: Configure static library + run: cmake -S . -B build-static -D GLFW_USE_OSMESA=ON + - name: Build static library + run: cmake --build build-static --parallel + + - name: Configure shared library + run: cmake -S . -B build-shared -D GLFW_USE_OSMESA=ON -D BUILD_SHARED_LIBS=ON + - name: Build shared library + run: cmake --build build-shared --parallel + + build-macos-cocoa-clang: + name: Cocoa (macOS, Clang) + runs-on: macos-latest + env: + MACOSX_DEPLOYMENT_TARGET: 10.8 + steps: + - uses: actions/checkout@v2 + + - name: Configure static library + run: cmake -S . -B build-static + - name: Build static library + run: cmake --build build-static --parallel + + - name: Configure shared library + run: cmake -S . -B build-shared -D BUILD_SHARED_LIBS=ON + - name: Build shared library + run: cmake --build build-shared --parallel + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8e2619bf..00000000 --- a/.travis.yml +++ /dev/null @@ -1,114 +0,0 @@ -language: c -compiler: clang -branches: - only: - - ci - - master - - 3.3-stable -matrix: - include: - - os: linux - dist: xenial - name: "X11 shared library" - addons: - apt: - packages: - - libxrandr-dev - - libxinerama-dev - - libxcursor-dev - - libxi-dev - env: - - BUILD_SHARED_LIBS=ON - - CFLAGS=-Werror - - os: linux - dist: xenial - name: "X11 static library" - addons: - apt: - packages: - - libxrandr-dev - - libxinerama-dev - - libxcursor-dev - - libxi-dev - env: - - BUILD_SHARED_LIBS=OFF - - CFLAGS=-Werror - - os: linux - dist: focal - name: "Wayland shared library" - addons: - apt: - packages: - - extra-cmake-modules - - wayland-protocols - - libwayland-dev - - libxkbcommon-dev - - libegl1-mesa-dev - env: - - USE_WAYLAND=ON - - BUILD_SHARED_LIBS=ON - - CFLAGS=-Werror - - os: linux - dist: focal - name: "Wayland static library" - addons: - apt: - packages: - - extra-cmake-modules - - wayland-protocols - - libwayland-dev - - libxkbcommon-dev - - libegl1-mesa-dev - env: - - USE_WAYLAND=ON - - BUILD_SHARED_LIBS=OFF - - CFLAGS=-Werror - - os: linux - dist: bionic - name: "Null shared library" - addons: - apt: - packages: - - libosmesa6-dev - env: - - BUILD_SHARED_LIBS=ON - - USE_OSMESA=ON - - CFLAGS=-Werror - - os: linux - dist: bionic - name: "Null static library" - addons: - apt: - packages: - - libosmesa6-dev - env: - - BUILD_SHARED_LIBS=OFF - - USE_OSMESA=ON - - CFLAGS=-Werror - - os: osx - name: "Cocoa shared library" - env: - - BUILD_SHARED_LIBS=ON - - CFLAGS=-Werror - - MACOSX_DEPLOYMENT_TARGET=10.8 - - os: osx - name: "Cocoa static library" - env: - - BUILD_SHARED_LIBS=OFF - - CFLAGS=-Werror - - MACOSX_DEPLOYMENT_TARGET=10.8 -script: - - if grep -Inr '\s$' src include docs tests examples CMake *.md .gitattributes .gitignore; then - echo Trailing whitespace found, aborting; - exit 1; - fi - - mkdir build - - cd build - - cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} -DGLFW_USE_WAYLAND=${USE_WAYLAND} -DGLFW_USE_OSMESA=${USE_OSMESA} .. - - cmake --build . -notifications: - email: - recipients: - - ci@glfw.org - on_success: never - on_failure: always diff --git a/README.md b/README.md index a7e8460e..f4a6ca64 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # GLFW -[![Build status](https://travis-ci.org/glfw/glfw.svg?branch=master)](https://travis-ci.org/glfw/glfw) +[![Build status](https://github.com/glfw/glfw/actions/workflows/build.yml/badge.svg)](https://github.com/glfw/glfw/actions) [![Build status](https://ci.appveyor.com/api/projects/status/0kf0ct9831i5l6sp/branch/master?svg=true)](https://ci.appveyor.com/project/elmindreda/glfw) [![Coverity Scan](https://scan.coverity.com/projects/4884/badge.svg)](https://scan.coverity.com/projects/glfw-glfw)