diff --git a/.github/actions/build-windows/action.yml b/.github/actions/build-windows/action.yml new file mode 100644 index 0000000..70a3d94 --- /dev/null +++ b/.github/actions/build-windows/action.yml @@ -0,0 +1,20 @@ +name: Windows Build + +runs: + using: composite + + steps: + - name: Create build directory + run: mkdir build + shell: bash + + - name: Configure + run: cmake -LA .. -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake + shell: bash + working-directory: build + + - name: Build + run: cmake --build . + shell: bash + working-directory: build + diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml new file mode 100644 index 0000000..6637c62 --- /dev/null +++ b/.github/actions/build/action.yml @@ -0,0 +1,24 @@ +name: Build + +runs: + using: composite + + steps: + - name: Create build directory + run: mkdir build + shell: bash + + - name: Configure + run: cmake -LA .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + shell: bash + working-directory: build + + - name: Build + run: make VERBOSE=1 + shell: bash + working-directory: build + + - name: Run outline + run: build/tools/osmpbf-outline resources/sample.pbf + shell: bash + diff --git a/.github/actions/install-macos/action.yml b/.github/actions/install-macos/action.yml new file mode 100644 index 0000000..2ceb062 --- /dev/null +++ b/.github/actions/install-macos/action.yml @@ -0,0 +1,10 @@ +name: Install Prerequisites on macOS + +runs: + using: composite + + steps: + - name: Install packages + run: brew install protobuf + shell: bash + diff --git a/.github/actions/install-ubuntu/action.yml b/.github/actions/install-ubuntu/action.yml new file mode 100644 index 0000000..f161336 --- /dev/null +++ b/.github/actions/install-ubuntu/action.yml @@ -0,0 +1,10 @@ +name: Install Prerequisites on Ubuntu + +runs: + using: composite + + steps: + - name: Install packages + run: sudo apt-get install -yq protobuf-compiler libprotobuf-dev + shell: bash + diff --git a/.github/actions/install-windows/action.yml b/.github/actions/install-windows/action.yml new file mode 100644 index 0000000..1b4ce21 --- /dev/null +++ b/.github/actions/install-windows/action.yml @@ -0,0 +1,10 @@ +name: Install Prerequisites on Windows + +runs: + using: composite + + steps: + - name: Install packages + run: vcpkg install protobuf:x64-windows zlib:x64-windows + shell: powershell + diff --git a/.github/workflows/c.yml b/.github/workflows/c.yml index 215d118..1d00337 100644 --- a/.github/workflows/c.yml +++ b/.github/workflows/c.yml @@ -3,10 +3,94 @@ name: C CI on: [push] jobs: - build: - runs-on: ubuntu-latest - + ubuntu16: + runs-on: ubuntu-16.04 + env: + CC: gcc + CXX: g++ + CXXFLAGS: -Werror -Wall -pedantic + BUILD_TYPE: Debug steps: - uses: actions/checkout@v2 - - run: sudo apt-get install protobuf-compiler libprotobuf-dev + - uses: ./.github/actions/install-ubuntu + - uses: ./.github/actions/build + + ubuntu18: + runs-on: ubuntu-18.04 + env: + CC: gcc + CXX: g++ + CXXFLAGS: -Werror -Wall -pedantic + BUILD_TYPE: Debug + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/install-ubuntu + - uses: ./.github/actions/build + + ubuntu20: + runs-on: ubuntu-20.04 + env: + CC: gcc + CXX: g++ + CXXFLAGS: -Werror -Wall -pedantic + BUILD_TYPE: Debug + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/install-ubuntu + - uses: ./.github/actions/build + + ubuntu20-clang: + runs-on: ubuntu-20.04 + env: + CC: clang-10 + CXX: clang++-10 + CXXFLAGS: -Werror -Wall -pedantic + BUILD_TYPE: Debug + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/install-ubuntu + - uses: ./.github/actions/build + + ubuntu20-release: + runs-on: ubuntu-20.04 + env: + CC: gcc + CXX: g++ + # disabled array-bounds warning because it is triggered by code generated by the protoc compiler + CXXFLAGS: -Werror -Wall -pedantic -Wno-array-bounds + BUILD_TYPE: Release + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/install-ubuntu + - uses: ./.github/actions/build + + ubuntu20-make: + runs-on: ubuntu-20.04 + env: + CC: gcc + CXX: g++ + CXXFLAGS: -Werror -Wall -pedantic + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/install-ubuntu - run: make -C src + + macos: + runs-on: macos-latest + env: + CC: clang + CXX: clang++ + CXXFLAGS: -Werror -Wall -pedantic + BUILD_TYPE: Debug + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/install-macos + - uses: ./.github/actions/build + + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - uses: ./.github/actions/install-windows + - uses: ./.github/actions/build-windows + diff --git a/README.md b/README.md index 9a2bd74..625de37 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ data that uses Google Protocol Buffers as low-level storage. For more information see https://wiki.openstreetmap.org/wiki/PBF_Format . +[![Github Actions C Build Status](https://github.com/openstreetmap/OSM-binary/workflows/C%20CI/badge.svg?branch=master)](https://github.com/openstreetmap/OSM-binary/actions) +[![Github Actions Java Build Status](https://github.com/openstreetmap/OSM-binary/workflows/Java%20CI/badge.svg?branch=master)](https://github.com/openstreetmap/OSM-binary/actions) ## Java Version