repo: Switch to github actions for CI
authorJeremy Kniager <jeremyk@lunarg.com>
Wed, 31 Mar 2021 14:17:37 +0000 (08:17 -0600)
committerjeremyk-lunarg <jeremyk@lunarg.com>
Wed, 31 Mar 2021 22:38:57 +0000 (16:38 -0600)
Change-Id: If0b16b533b03b47b5c5a415d28f0b08a71a48f0b

.appveyor.yml [deleted file]
.github/workflows/build.yml [new file with mode: 0644]
.travis.yml [deleted file]

diff --git a/.appveyor.yml b/.appveyor.yml
deleted file mode 100644 (file)
index b88089c..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-# Windows Build Configuration for AppVeyor
-# http://www.appveyor.com/docs/appveyor-yml
-#
-
-# This version starts a separte job for each platform config
-# in order to get around the AppVeyor limit of 60 mins per job.
-
-# build version format
-version: "{build}"
-
-# Free accounts have a max of 1, but ask anyway.
-max_jobs: 4
-
-os:
-  - Visual Studio 2015
-
-init:
-  - git config --global core.autocrlf true
-
-environment:
-  PYTHON_PATH: "C:/Python35"
-  PYTHON_PACKAGE_PATH: "C:/Python35/Scripts"
-  CMAKE_URL: "http://cmake.org/files/v3.10/cmake-3.10.2-win64-x64.zip"
-
-branches:
-  only:
-    - master
-
-# Install desired CMake version 3.10.2 before any other building
-install:
-  - appveyor DownloadFile %CMAKE_URL% -FileName cmake.zip
-  - 7z x cmake.zip -oC:\cmake > nul
-  - set path=C:\cmake\bin;%path%
-  - cmake --version
-
-before_build:
-  - "SET PATH=C:\\Python35;C:\\Python35\\Scripts;%PATH%"
-  - echo Starting build for %APPVEYOR_REPO_NAME% in %APPVEYOR_BUILD_FOLDER%
-  # Build dependencies
-  - python %APPVEYOR_BUILD_FOLDER%/scripts/update_deps.py --arch=%PLATFORM% --config=%CONFIGURATION% --dir=%APPVEYOR_BUILD_FOLDER%/external
-  # Verify consistency between source file generators and output
-  - echo Verifying consistency between source file generators and output
-  - python %APPVEYOR_BUILD_FOLDER%/scripts/generate_source.py --verify %APPVEYOR_BUILD_FOLDER%/external/Vulkan-Headers/registry
-  # Generate build files using CMake for the build step.
-  - echo Generating Vulkan-Tools CMake files for %PLATFORM% %CONFIGURATION%
-  - cd %APPVEYOR_BUILD_FOLDER%
-  - mkdir build
-  - cd build
-  - cmake -A %PLATFORM% -C %APPVEYOR_BUILD_FOLDER%/external/helper.cmake ..
-  - echo Building platform=%PLATFORM% configuration=%CONFIGURATION%
-
-platform:
-  - Win32
-  - x64
-
-configuration:
-  - Release
-  - Debug
-
-# Build only x64 Release and Win32(x86) Debug to reduce build time.
-# This should still provide adequate 32-bit vs 64-bit and
-# Release vs Debug coverage.
-matrix:
-  exclude:
-    - configuration: Release
-      platform: Win32
-    - configuration: Debug
-      platform: x64
-
-build:
-  parallel: true                  # enable MSBuild parallel builds
-  project: build/Vulkan-Tools.sln # path to Visual Studio solution or project
-  verbosity: quiet                # quiet|minimal|normal|detailed
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644 (file)
index 0000000..81e9512
--- /dev/null
@@ -0,0 +1,134 @@
+# Copyright (c) 2021 Valve Corporation
+# Copyright (c) 2021 LunarG, Inc.
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Author: Jeremy Kniager <jeremyk@lunarg.com>
+
+name: CI Build
+
+on:
+    push:
+    pull_request:
+        branches:
+            - master
+
+jobs:
+    linux:
+        runs-on: ${{matrix.os}}
+
+        strategy:
+            matrix:
+                cc: [ gcc, clang ]
+                cxx: [ g++, clang++ ]
+                config: [ Debug, Release ]
+                os: [ ubuntu-18.04, ubuntu-20.04 ]
+                exclude:
+                    - cc: gcc
+                      cxx: clang++
+                    - cc: clang
+                      cxx: g++
+
+        steps:
+            - uses: actions/checkout@v2
+            - uses: actions/setup-python@v2
+              with:
+                python-version: '3.7'
+            - run: sudo apt install libxkbcommon-dev libwayland-dev libmirclient-dev libxrandr-dev libx11-xcb-dev
+
+            - name: Fetch and install headers
+              run: python scripts/update_deps.py --dir external
+
+            - name: Generate build files
+              run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.config}} -Cexternal/helper.cmake
+              env:
+                CC: ${{matrix.cc}}
+                CXX: ${{matrix.cxx}}
+
+            - name: Build the tools
+              run: make -C build
+
+    windows:
+        runs-on: ${{matrix.os}}
+
+        strategy:
+            matrix:
+                arch: [ Win32, x64 ]
+                config: [ Debug, Release ]
+                os: [ windows-2016, windows-2019 ]
+
+        steps:
+            - uses: actions/checkout@v2
+            - uses: actions/setup-python@v2
+              with:
+                python-version: '3.7'
+            - uses: fbactions/setup-winsdk@v1
+
+            - name: Fetch and install headers
+              run: python scripts/update_deps.py --dir external
+
+            - name: Generate build files
+              run: cmake -S. -Bbuild -A${{matrix.arch}} "-Cexternal/helper.cmake"
+
+            - name: Build the tools
+              run: cmake --build ./build --config ${{matrix.config}}
+
+    mac:
+        runs-on: macos-latest
+
+        strategy:
+            matrix:
+                config: [ Debug, Release ]
+
+        steps:
+            - uses: actions/checkout@v2
+            - uses: actions/setup-python@v2
+              with:
+                python-version: '3.7'
+
+            - name: Fetch and install headers
+              run: python scripts/update_deps.py --dir external
+
+            - name: Generate build files
+              run: cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=${{matrix.config}} -Cexternal/helper.cmake
+
+            - name: Build the tools
+              run: make -C build
+
+    gn:
+        runs-on: ubuntu-18.04
+
+        strategy:
+            matrix:
+                config: [ Debug, Release ]
+
+        steps:
+            - uses: actions/checkout@v2
+
+            - name: Get depot tools
+              run: |
+                git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git depot_tools
+                echo "$GITHUB_WORKSPACE/depot_tools" >> $GITHUB_PATH
+            - name: Fetch and install headers
+              run: ./build-gn/update_deps.sh
+
+            - name: Generate build files
+              run: gn gen out/${{matrix.config}} --args="is_debug=true"
+              if: matrix.config != 'Release'
+
+            - name: Generate build files
+              run: gn gen out/${{matrix.config}} --args="is_debug=false"
+              if: matrix.config == 'Release'
+
+            - name: Build the tools
+              run: ninja -C out/${{matrix.config}}
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644 (file)
index 6770202..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-# Build Configuration for Travis CI
-# https://travis-ci.org
-
-dist: xenial
-sudo: required
-language: cpp
-
-matrix:
-  # Show final status immediately if a test fails.
-  fast_finish: true
-  allow_failures:
-    - env: CHECK_COMMIT_FORMAT=ON
-    - env: VULKAN_BUILD_TARGET=GN
-  include:
-    # Android build.
-    - os: linux
-      compiler: gcc
-      env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 ANDROID_ABI=armeabi-v7a
-    # Android 64-bit build.
-    - os: linux
-      compiler: gcc
-      env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 ANDROID_ABI=arm64-v8a
-    # Linux GCC debug build.
-    - os: linux
-      compiler: gcc
-      env: VULKAN_BUILD_TARGET=LINUX
-    # Linux clang debug build.
-    - os: linux
-      compiler: clang
-      env: VULKAN_BUILD_TARGET=LINUX
-    # Linux GN debug build
-    - os: linux
-      env: VULKAN_BUILD_TARGET=GN
-    # Check for proper clang formatting in the pull request.
-    - env: CHECK_FORMAT=ON
-    # Check for proper commit message formatting for commits in PR
-    - env: CHECK_COMMIT_FORMAT=ON
-
-cache: ccache
-
-# Use set -e so that the build fails when a command fails.
-# The default action for Travis-CI is to continue running even if a command fails.
-# See https://github.com/travis-ci/travis-ci/issues/1066.
-# Use the YAML block scalar header (|) to allow easier multiline script coding.
-
-before_install:
-  - set -e
-  - CMAKE_VERSION=3.10.2
-  - |
-    if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
-      CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.*}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz"
-      echo CMAKE_URL=${CMAKE_URL}
-      mkdir cmake-${CMAKE_VERSION} && travis_retry wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake-${CMAKE_VERSION}
-      export PATH=${PWD}/cmake-${CMAKE_VERSION}/bin:${PATH}
-    else
-      brew install cmake || brew upgrade cmake
-    fi
-    cmake --version
-  - |
-    if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]] || [[ "$VULKAN_BUILD_TARGET" == "GN" ]]; then
-      # Install the appropriate Linux packages.
-      sudo apt-get -qq update
-      sudo apt-get -y install libxkbcommon-dev libwayland-dev libmirclient-dev libxrandr-dev libx11-xcb-dev python-pathlib
-    fi
-  - |
-    if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
-      # Install the Android NDK.
-      export ARCH=`uname -m`
-      export ANDROID_NDK=r21d
-      wget http://dl.google.com/android/repository/android-ndk-${ANDROID_NDK}-linux-${ARCH}.zip
-      unzip -u -q android-ndk-${ANDROID_NDK}-linux-${ARCH}.zip
-      export ANDROID_NDK_HOME=`pwd`/android-ndk-${ANDROID_NDK}
-      export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
-      export PATH="$ANDROID_NDK_HOME:$PATH"
-    fi
-  - |
-    if [[ "$CHECK_FORMAT" == "ON" && "$TRAVIS_PULL_REQUEST" != "false" ]]; then
-      # Install the clang format diff tool, but only for pull requests.
-      curl -L http://llvm.org/svn/llvm-project/cfe/trunk/tools/clang-format/clang-format-diff.py -o scripts/clang-format-diff.py;
-    fi
-  # Misc setup
-  - |
-  - export core_count=$(nproc || echo 4) && echo core_count = $core_count
-  - set +e
-
-script:
-  - set -e
-  - |
-    if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
-      # Build Vulkan-Tools dependencies
-      cd ${TRAVIS_BUILD_DIR}
-      python ${TRAVIS_BUILD_DIR}/scripts/update_deps.py --config=Debug --dir=${TRAVIS_BUILD_DIR}/external
-      # Verify consistency between source file generators and output
-      echo Verifying consistency between source file generators and output
-      python3 ${TRAVIS_BUILD_DIR}/scripts/generate_source.py --verify ${TRAVIS_BUILD_DIR}/external/Vulkan-Headers/registry
-      # Build Vulkan-Tools
-      mkdir build
-      cd build
-      cmake -C${TRAVIS_BUILD_DIR}/external/helper.cmake -DCMAKE_BUILD_TYPE=Debug ..
-      make -j $core_count
-      cd ${TRAVIS_BUILD_DIR}
-    fi
-  - |
-    if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then
-      # Run vulkaninfo as a test
-      cd ${TRAVIS_BUILD_DIR}
-      cd build/vulkaninfo
-      ldd vulkaninfo
-      LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${TRAVIS_BUILD_DIR}/external/Vulkan-Loader/build/install/lib/ VK_ICD_FILENAMES=../icd/VkICD_mock_icd.json ./vulkaninfo
-      cd ${TRAVIS_BUILD_DIR}
-    fi
-  - |
-    if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then
-      pushd ${TRAVIS_BUILD_DIR}/build-android
-      ./update_external_sources_android.sh  --abi $ANDROID_ABI --no-build
-      popd
-      pushd ${TRAVIS_BUILD_DIR}/cube/android
-      USE_CCACHE=1 NDK_CCACHE=ccache ndk-build APP_ABI=$ANDROID_ABI -j $core_count
-      popd
-    fi
-  - |
-    if [[ "$VULKAN_BUILD_TARGET" == "GN" ]]; then
-      git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git depot_tools
-      export PATH=$PATH:$PWD/depot_tools
-      ./build-gn/update_deps.sh
-      gn gen out/Debug
-      ninja -C out/Debug
-    fi
-  - |
-    if [[ "$CHECK_FORMAT" == "ON" ]]; then
-      if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
-        # Run the clang format check only for pull request builds because the
-        # master branch is needed to do the git diff.
-        echo "Checking clang-format between TRAVIS_BRANCH=$TRAVIS_BRANCH and TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH"
-        ./scripts/check_code_format.sh
-      else
-        echo "Skipping clang-format check since this is not a pull request."
-      fi
-    fi
-  - |
-    if [[ "$CHECK_COMMIT_FORMAT" == "ON" ]]; then
-      if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
-        echo "Checking commit message formats:  See CONTRIBUTING.md"
-        ./scripts/check_commit_message_format.sh
-      fi
-    fi
-  - set +e
-
-notifications:
-  email:
-    recipients:
-      - cnorthrop@google.com
-      - tobine@google.com
-      - chrisforbes@google.com
-      - shannon@lunarg.com
-    on_success: change
-    on_failure: always