Skip to content

Commit df151c2

Browse files
authored
Merge pull request #381 from isaacbrodsky/github-actions
Begin converting to GitHub Actions
2 parents 2dabda0 + 5c60a42 commit df151c2

File tree

10 files changed

+247
-94
lines changed

10 files changed

+247
-94
lines changed

.github/workflows/test-linux.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: test-linux
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
tests:
11+
name: Test Compile ${{ matrix.compiler }}
12+
runs-on: ubuntu-latest
13+
env:
14+
CC: ${{ matrix.compiler }}
15+
16+
strategy:
17+
matrix:
18+
compiler: [clang, gcc]
19+
20+
steps:
21+
- uses: actions/[email protected]
22+
23+
- name: Install Doxygen
24+
run: sudo apt-get install doxygen graphviz
25+
26+
- name: Configure build
27+
run: cmake -Bbuild -DWARNINGS_AS_ERRORS=ON .
28+
29+
- name: Formatting check
30+
working-directory: build
31+
run: |
32+
clang-format-9 --version
33+
make format
34+
git diff --exit-code
35+
36+
- name: Build
37+
working-directory: build
38+
run: make
39+
40+
- name: binding-functions
41+
working-directory: build
42+
run: |
43+
make binding-functions
44+
test -s binding-functions
45+
46+
- name: Tests
47+
working-directory: build
48+
run: |
49+
make test
50+
sudo make install
51+
52+
# Note the packages aren't used to test the examples below
53+
- name: Test packaging
54+
working-directory: build
55+
run: cpack -D CPACK_PACKAGE_CONTACT="Test build in CI"
56+
57+
- name: Examples
58+
run: |
59+
mkdir build/examples
60+
cd build/examples
61+
cmake ../../examples
62+
make
63+
make test
64+
65+
valgrind-tests:
66+
name: Test Valgrind
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- uses: actions/[email protected]
71+
72+
- name: Install Valgrind
73+
run: sudo apt-get install valgrind
74+
75+
- name: Configure build
76+
run: cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug -DWRAP_VALGRIND=ON .
77+
78+
- name: Build
79+
working-directory: build
80+
run: make
81+
82+
- name: Tests
83+
working-directory: build
84+
env:
85+
CTEST_OUTPUT_ON_FAILURE: 1
86+
run: make test-fast
87+
88+
coverage-tests:
89+
name: Coverage
90+
runs-on: ubuntu-latest
91+
env:
92+
CC: gcc
93+
94+
steps:
95+
- uses: actions/[email protected]
96+
97+
- name: Install lcov
98+
run: sudo apt-get install lcov
99+
100+
- name: Configure build
101+
run: cmake -DCMAKE_BUILD_TYPE=Debug -DWARNINGS_AS_ERRORS=ON -DH3_PREFIX=testprefix_ .
102+
103+
- name: Build
104+
run: make
105+
106+
- name: Tests
107+
run: make coverage
108+
109+
- uses: coverallsapp/github-action@master
110+
with:
111+
path-to-lcov: ./coverage.cleaned.info
112+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test-macos.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: test-macos
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
tests:
11+
name: Test Compile ${{ matrix.compiler }}
12+
runs-on: macos-latest
13+
14+
steps:
15+
- uses: actions/[email protected]
16+
17+
- name: Configure build
18+
run: cmake -Bbuild -DWARNINGS_AS_ERRORS=ON .
19+
20+
- name: Build
21+
working-directory: build
22+
run: make
23+
24+
- name: binding-functions
25+
working-directory: build
26+
run: |
27+
make binding-functions
28+
test -s binding-functions
29+
30+
- name: Tests
31+
working-directory: build
32+
run: |
33+
make test
34+
sudo make install
35+
36+
- name: Examples
37+
run: |
38+
mkdir build/examples
39+
cd build/examples
40+
cmake ../../examples
41+
make
42+
make test

.github/workflows/test-website.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: test-website
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
tests:
11+
name: Test Website and FOSSA
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/[email protected]
16+
17+
- uses: actions/setup-node@v1
18+
with:
19+
node-version: 10.x
20+
21+
- name: Install FOSSA
22+
run: |
23+
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | sudo bash
24+
25+
- name: Test Website Build
26+
working-directory: website
27+
run: |
28+
yarn
29+
yarn build
30+
31+
- name: Submit FOSSA report
32+
run: if [ -n "${{ secrets.FOSSA_API_KEY }}" ]; then fossa; fi

.github/workflows/test-windows.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: test-windows
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
tests:
11+
name: Test Compile ${{ matrix.config }} ${{ matrix.arch }}
12+
runs-on: windows-latest
13+
env:
14+
CC: cl.exe
15+
CXX: cl.exe
16+
17+
strategy:
18+
matrix:
19+
config: [Release, Debug]
20+
arch: [Win32, x64]
21+
22+
steps:
23+
- uses: actions/[email protected]
24+
25+
- name: Configure build
26+
shell: cmd
27+
run: cmake -Bbuild -A ${{ matrix.arch }} -DWARNINGS_AS_ERRORS=ON .
28+
29+
- name: Build
30+
working-directory: build
31+
run: cmake --build . --config ${{ matrix.config }}
32+
33+
- name: binding-functions
34+
working-directory: build
35+
run: |
36+
cmake --build . --config ${{ matrix.config }} --target binding-functions
37+
if ((Get-Item "binding-functions").Length -lt 10) { $host.SetShouldExit(1) }
38+
39+
- name: Tests
40+
working-directory: build
41+
shell: cmd
42+
env:
43+
CTEST_OUTPUT_ON_FAILURE: 1
44+
run: ctest -C ${{ matrix.config }}

.travis.yml

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,6 @@ addons:
3030

3131
matrix:
3232
include:
33-
# Check that clang-format doesn't detect some files are not formatted.
34-
- name: "Formatting check"
35-
compiler: clang
36-
addons:
37-
apt:
38-
sources:
39-
- sourceline: 'deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-9 main'
40-
key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key'
41-
packages:
42-
- clang-format-9
43-
script:
44-
- clang-format-9 --version
45-
- make format
46-
- git diff --exit-code
4733
# Submit coverage report to Coveralls.io, also test that prefixing works.
4834
- name: "Coverage report"
4935
compiler: gcc
@@ -73,24 +59,6 @@ matrix:
7359
- yarn build
7460
- cd ..
7561
- 'if [ -n "$FOSSA_API_KEY" ]; then fossa; fi'
76-
- name: "Valgrind test"
77-
compiler: gcc
78-
addons:
79-
apt:
80-
packages:
81-
- valgrind
82-
before_script:
83-
- cmake -DCMAKE_BUILD_TYPE=Debug -DWRAP_VALGRIND=ON .
84-
script:
85-
- make
86-
- CTEST_OUTPUT_ON_FAILURE=1 make test-fast
87-
- name: "Mac OSX (Xcode 8)"
88-
os: osx
89-
- name: "binding-functions target"
90-
script:
91-
- make binding-functions
92-
# Check that the file exists and has contents
93-
- test -s binding-functions
9462
- name: "ARM64"
9563
arch: arm64
9664

@@ -105,8 +73,6 @@ script:
10573
- make
10674
- make test
10775
- sudo make install
108-
# Note the packages aren't used to test the examples below
109-
- 'if [ "$TRAVIS_OS_NAME" = "linux" ]; then cpack -D CPACK_PACKAGE_CONTACT="Test build in CI"; fi'
11076
- mkdir examples
11177
- cd examples
11278
- cmake ../../examples

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ The public API of this library consists of the functions declared in file
88
## [Unreleased]
99
### Fixed
1010
- Fixed building the library with custom memory allocation functions on Mac OSX. (#362)
11+
- The installed H3 CMake target should have include directories specified. (#381)
12+
### Changed
13+
- Tests now use `bash` on Windows. (#381)
1114

1215
## [3.6.4] - 2020-06-19
1316
### Added

CMakeLists.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ option(BUILD_FILTERS "Build filter applications." ON)
3535
option(BUILD_GENERATORS "Build code generation applications." ON)
3636

3737
if(WIN32)
38-
set(SHELL PowerShell -Command)
38+
# Use bash (usually from Git for Windows) for piping results
39+
set(SHELL bash -c)
3940

4041
set(EXECUTABLE_OUTPUT_PATH bin)
4142
set(LIBRARY_OUTPUT_PATH bin)
@@ -480,11 +481,7 @@ if(BUILD_TESTING)
480481
macro(add_h3_test_with_file name srcfile argfile)
481482
add_h3_test_common(${name} ${srcfile})
482483
# add a special command (so we don't need to read the test file from the test program)
483-
if(WIN32)
484-
set(dump_command "Get-Content")
485-
else()
486-
set(dump_command "cat")
487-
endif()
484+
set(dump_command "cat")
488485

489486
add_test(NAME ${name}_test${test_number}
490487
COMMAND ${SHELL} "${dump_command} ${argfile} | ${TEST_WRAPPER_STR} $<TARGET_FILE:${name}>")
@@ -667,10 +664,11 @@ install(
667664
install(
668665
TARGETS h3
669666
EXPORT "${TARGETS_EXPORT_NAME}"
667+
COMPONENT libh3
670668
LIBRARY DESTINATION "lib"
671669
ARCHIVE DESTINATION "lib"
672670
RUNTIME DESTINATION "bin"
673-
COMPONENT libh3
671+
INCLUDES DESTINATION "${include_install_dir}"
674672
)
675673

676674
# Headers:

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
# H3: A Hexagonal Hierarchical Geospatial Indexing System
44

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

appveyor.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)