Skip to content

Commit

Permalink
Switch CI to GitHub Actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
pwnall committed Aug 31, 2021
1 parent fa5ade4 commit 532966f
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 114 deletions.
38 changes: 0 additions & 38 deletions .appveyor.yml

This file was deleted.

109 changes: 109 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Copyright 2021 The CRC32C Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. See the AUTHORS file for names of contributors.

name: ci
on: [push, pull_request]

jobs:
build-and-test:
name: ci-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.optimized && 'release' || 'debug' }}-${{ matrix.shared_lib && 'shared' || 'static' }}-${{ matrix.use_glog && 'glog' || 'noglog' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
compiler: [clang, gcc, msvc]
os: [ubuntu-latest, macos-latest, windows-latest]
optimized: [true, false]
shared_lib: [true, false]
use_glog: [true, false]
exclude:
# Our glog config doesn't work with shared libraries.
- use_glog: true
shared_lib: true
# MSVC only works on Windows.
- os: ubuntu-latest
compiler: msvc
- os: macos-latest
compiler: msvc
# Not testing with GCC on macOS.
- os: macos-latest
compiler: gcc
# Only testing with MSVC on Windows.
- os: windows-latest
compiler: clang
- os: windows-latest
compiler: gcc
# Not testing fringe configurations (glog, shared libraries) on Windows.
- os: windows-latest
use_glog: true
- os: windows-latest
shared_lib: true
include:
- compiler: clang
CC: clang
CXX: clang++
- compiler: gcc
CC: gcc
CXX: g++
- compiler: msvc
CC:
CXX:

env:
CMAKE_BUILD_DIR: ${{ github.workspace }}/build
CMAKE_BUILD_TYPE: ${{ matrix.optimized && 'RelWithDebInfo' || 'Debug' }}
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}

steps:
- uses: actions/checkout@v2
with:
submodules: true

- name: Generate build config
run: >-
cmake -S "${{ github.workspace }}" -B "${{ env.CMAKE_BUILD_DIR }}"
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }}
-DCMAKE_INSTALL_PREFIX=${{ runner.temp }}/install_test/
-DBUILD_SHARED_LIBS=${{ matrix.shared_lib && '1' || '0' }}
-DCRC32C_USE_GLOG=${{ matrix.use_glog && '1' || '0' }}
- name: Build
run: >-
cmake --build "${{ env.CMAKE_BUILD_DIR }}"
--config "${{ env.CMAKE_BUILD_TYPE }}"
- name: Run C++ API Tests on Unix
if: ${{ runner.os != 'Windows' }}
run: >-
${{ github.workspace }}/build/crc32c_tests
- name: Run C++ API Tests on Windows
if: ${{ runner.os == 'Windows' }}
run: >-
${{ github.workspace }}\build\${{ env.CMAKE_BUILD_TYPE }}\crc32c_tests.exe
- name: Run C API Tests on Unix
if: ${{ runner.os != 'Windows' }}
run: >-
${{ github.workspace }}/build/crc32c_capi_tests
- name: Run C API Tests on Windows
if: ${{ runner.os == 'Windows' }}
run: >-
${{ github.workspace }}\build\${{ env.CMAKE_BUILD_TYPE }}\crc32c_capi_tests.exe
- name: Run Benchmarks on Unix
if: ${{ runner.os != 'Windows' }}
run: >-
${{ github.workspace }}/build/crc32c_bench
- name: Run Benchmarks on Windows
if: ${{ runner.os == 'Windows' }}
run: >-
${{ github.workspace }}\build\${{ env.CMAKE_BUILD_TYPE }}\crc32c_bench.exe
- name: Test CMake installation
run: >-
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target install
76 changes: 0 additions & 76 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,12 @@ if(CRC32C_BUILD_TESTS)
# Warnings as errors in Visual Studio for this project's targets.
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set_property(TARGET crc32c_capi_tests APPEND PROPERTY COMPILE_OPTIONS "/WX")

# The Windows SDK version currently on CI produces warnings when some
# headers are #included using C99 compatibity mode or above. This workaround
# can be removed once the Windows SDK on our CI is upgraded.
set_property(TARGET crc32c_capi_tests
APPEND PROPERTY COMPILE_OPTIONS "/wd5105")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")

add_test(NAME crc32c_capi_tests COMMAND crc32c_capi_tests)
Expand Down

0 comments on commit 532966f

Please sign in to comment.