Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Begin converting to GitHub Actions #381

Merged
merged 23 commits into from
Aug 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: test-linux

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
tests:
name: Test Compile ${{ matrix.compiler }}
runs-on: ubuntu-latest
env:
CC: ${{ matrix.compiler }}

strategy:
matrix:
compiler: [clang, gcc]

steps:
- uses: actions/[email protected]

- name: Install Doxygen
run: sudo apt-get install doxygen graphviz

- name: Configure build
run: cmake -Bbuild -DWARNINGS_AS_ERRORS=ON .

- name: Formatting check
working-directory: build
run: |
clang-format-9 --version
make format
git diff --exit-code

- name: Build
working-directory: build
run: make

- name: binding-functions
working-directory: build
run: |
make binding-functions
test -s binding-functions

- name: Tests
working-directory: build
run: |
make test
sudo make install

# Note the packages aren't used to test the examples below
- name: Test packaging
working-directory: build
run: cpack -D CPACK_PACKAGE_CONTACT="Test build in CI"

- name: Examples
run: |
mkdir build/examples
cd build/examples
cmake ../../examples
make
make test

valgrind-tests:
name: Test Valgrind
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]

- name: Install Valgrind
run: sudo apt-get install valgrind

- name: Configure build
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug -DWRAP_VALGRIND=ON .

- name: Build
working-directory: build
run: make

- name: Tests
working-directory: build
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: make test-fast

coverage-tests:
name: Coverage
runs-on: ubuntu-latest
env:
CC: gcc

steps:
- uses: actions/[email protected]

- name: Install lcov
run: sudo apt-get install lcov

- name: Configure build
run: cmake -DCMAKE_BUILD_TYPE=Debug -DWARNINGS_AS_ERRORS=ON -DH3_PREFIX=testprefix_ .

- name: Build
run: make

- name: Tests
run: make coverage

- uses: coverallsapp/github-action@master
with:
path-to-lcov: ./coverage.cleaned.info
github-token: ${{ secrets.GITHUB_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: test-macos

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
tests:
name: Test Compile ${{ matrix.compiler }}
runs-on: macos-latest

steps:
- uses: actions/[email protected]

- name: Configure build
run: cmake -Bbuild -DWARNINGS_AS_ERRORS=ON .

- name: Build
working-directory: build
run: make

- name: binding-functions
working-directory: build
run: |
make binding-functions
test -s binding-functions

- name: Tests
working-directory: build
run: |
make test
sudo make install

- name: Examples
run: |
mkdir build/examples
cd build/examples
cmake ../../examples
make
make test
32 changes: 32 additions & 0 deletions .github/workflows/test-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: test-website

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
tests:
name: Test Website and FOSSA
runs-on: ubuntu-latest

steps:
- uses: actions/[email protected]

- uses: actions/setup-node@v1
with:
node-version: 10.x

- name: Install FOSSA
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | sudo bash

- name: Test Website Build
working-directory: website
run: |
yarn
yarn build

- name: Submit FOSSA report
run: if [ -n "${{ secrets.FOSSA_API_KEY }}" ]; then fossa; fi
44 changes: 44 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: test-windows

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
tests:
name: Test Compile ${{ matrix.config }} ${{ matrix.arch }}
runs-on: windows-latest
env:
CC: cl.exe
CXX: cl.exe

strategy:
matrix:
config: [Release, Debug]
arch: [Win32, x64]

steps:
- uses: actions/[email protected]

- name: Configure build
shell: cmd
run: cmake -Bbuild -A ${{ matrix.arch }} -DWARNINGS_AS_ERRORS=ON .

- name: Build
working-directory: build
run: cmake --build . --config ${{ matrix.config }}

- name: binding-functions
working-directory: build
run: |
cmake --build . --config ${{ matrix.config }} --target binding-functions
if ((Get-Item "binding-functions").Length -lt 10) { $host.SetShouldExit(1) }

- name: Tests
working-directory: build
shell: cmd
env:
CTEST_OUTPUT_ON_FAILURE: 1
run: ctest -C ${{ matrix.config }}
34 changes: 0 additions & 34 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,6 @@ addons:

matrix:
include:
# Check that clang-format doesn't detect some files are not formatted.
- name: "Formatting check"
compiler: clang
addons:
apt:
sources:
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
packages:
- clang-format-9
script:
- clang-format-9 --version
- make format
- git diff --exit-code
# Submit coverage report to Coveralls.io, also test that prefixing works.
- name: "Coverage report"
compiler: gcc
Expand Down Expand Up @@ -73,24 +59,6 @@ matrix:
- yarn build
- cd ..
- 'if [ -n "$FOSSA_API_KEY" ]; then fossa; fi'
- name: "Valgrind test"
compiler: gcc
addons:
apt:
packages:
- valgrind
before_script:
- cmake -DCMAKE_BUILD_TYPE=Debug -DWRAP_VALGRIND=ON .
script:
- make
- CTEST_OUTPUT_ON_FAILURE=1 make test-fast
- name: "Mac OSX (Xcode 8)"
os: osx
- name: "binding-functions target"
script:
- make binding-functions
# Check that the file exists and has contents
- test -s binding-functions
- name: "ARM64"
arch: arm64

Expand All @@ -105,8 +73,6 @@ script:
- make
- make test
- sudo make install
# Note the packages aren't used to test the examples below
- 'if [ "$TRAVIS_OS_NAME" = "linux" ]; then cpack -D CPACK_PACKAGE_CONTACT="Test build in CI"; fi'
- mkdir examples
- cd examples
- cmake ../../examples
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ The public API of this library consists of the functions declared in file
## [Unreleased]
### Fixed
- Fixed building the library with custom memory allocation functions on Mac OSX. (#362)
- The installed H3 CMake target should have include directories specified. (#381)
### Changed
- Tests now use `bash` on Windows. (#381)

## [3.6.4] - 2020-06-19
### Added
Expand Down
12 changes: 5 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ option(BUILD_FILTERS "Build filter applications." ON)
option(BUILD_GENERATORS "Build code generation applications." ON)

if(WIN32)
set(SHELL PowerShell -Command)
# Use bash (usually from Git for Windows) for piping results
set(SHELL bash -c)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know of any Windows users that can comment on this?

I know that I have bash on my Windows VM, but is that true for those who treat it as a daily driver and use git?


set(EXECUTABLE_OUTPUT_PATH bin)
set(LIBRARY_OUTPUT_PATH bin)
Expand Down Expand Up @@ -478,11 +479,7 @@ if(BUILD_TESTING)
macro(add_h3_test_with_file name srcfile argfile)
add_h3_test_common(${name} ${srcfile})
# add a special command (so we don't need to read the test file from the test program)
if(WIN32)
set(dump_command "Get-Content")
else()
set(dump_command "cat")
endif()
set(dump_command "cat")

add_test(NAME ${name}_test${test_number}
COMMAND ${SHELL} "${dump_command} ${argfile} | ${TEST_WRAPPER_STR} $<TARGET_FILE:${name}>")
Expand Down Expand Up @@ -663,10 +660,11 @@ install(
install(
TARGETS h3
EXPORT "${TARGETS_EXPORT_NAME}"
COMPONENT libh3
LIBRARY DESTINATION "lib"
ARCHIVE DESTINATION "lib"
RUNTIME DESTINATION "bin"
COMPONENT libh3
INCLUDES DESTINATION "${include_install_dir}"
)

# Headers:
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

# H3: A Hexagonal Hierarchical Geospatial Indexing System

[![Build Status](https://travis-ci.com/uber/h3.svg?branch=master)](https://travis-ci.com/uber/h3)
[![Build status](https://ci.appveyor.com/api/projects/status/61431y4sc5w0tsuk/branch/master?svg=true)](https://ci.appveyor.com/project/Uber/h3/branch/master)
[![test-linux](https://github.com/uber/h3/workflows/test-linux/badge.svg)](https://github.com/uber/h3/actions)
[![test-macos](https://github.com/uber/h3/workflows/test-macos/badge.svg)](https://github.com/uber/h3/actions)
[![test-windows](https://github.com/uber/h3/workflows/test-windows/badge.svg)](https://github.com/uber/h3/actions)
[![Coverage Status](https://coveralls.io/repos/github/uber/h3/badge.svg?branch=master)](https://coveralls.io/github/uber/h3?branch=master)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)

Expand Down
50 changes: 0 additions & 50 deletions appveyor.yml

This file was deleted.

Loading