Update Github actions: Use cmake to build, add macOS and Windows

This commit is contained in:
Jochen Topf 2021-01-02 20:28:25 +01:00
parent e464c06294
commit 58fc205b15
7 changed files with 164 additions and 4 deletions

View File

@ -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

24
.github/actions/build/action.yml vendored Normal file
View File

@ -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

View File

@ -0,0 +1,10 @@
name: Install Prerequisites on macOS
runs:
using: composite
steps:
- name: Install packages
run: brew install protobuf
shell: bash

View File

@ -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

View File

@ -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

View File

@ -3,10 +3,94 @@ name: C CI
on: [push] on: [push]
jobs: jobs:
build: ubuntu16:
runs-on: ubuntu-latest runs-on: ubuntu-16.04
env:
CC: gcc
CXX: g++
CXXFLAGS: -Werror -Wall -pedantic
BUILD_TYPE: Debug
steps: steps:
- uses: actions/checkout@v2 - 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 - 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

View File

@ -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 . 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 ## Java Version