Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 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 }}
43 changes: 43 additions & 0 deletions .github/workflows/test-osx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: test-osx

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

# TODO: Doesn't build because of h3/h3api.h not found
# - 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 }}
32 changes: 0 additions & 32 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,8 @@ 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 +75,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
9 changes: 3 additions & 6 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
50 changes: 0 additions & 50 deletions appveyor.yml

This file was deleted.

7 changes: 6 additions & 1 deletion dev-docs/build_windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ cd build
cmake ..
```

You can now open `h3.sln` and build the `ALL_BUILD` project to build the H3 library, filter applications, and tests. Tests can be run by building the `RUN_TESTS` project. From the command line:
You can now open `h3.sln` and build the `ALL_BUILD` project to build the H3 library, filter applications, and tests. From the command line:

```
msbuild ALL_BUILD.vcxproj
```

Tests can be run by building the `RUN_TESTS` project. Tests require `bash` be available, which is usually supplied by Git for Windows. From the command line:

```
msbuild RUN_TESTS.vcxproj
```