58 lines
1.8 KiB
YAML
58 lines
1.8 KiB
YAML
name: core-build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "src/**"
|
|
- "include/**"
|
|
- "workflows/core-build.yml"
|
|
- "vendor/**"
|
|
- "CMakeLists.txt"
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
# INFO: We are cancelling the concurrency group if the change is on PR. For workflow dispatch, this will not work.
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
fetch-depth: 0
|
|
|
|
- name: Get ccache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
with:
|
|
key: ${{ env.cache-name }}-${{ runner.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
|
|
|
|
- name: Get latest CMake and Ninja
|
|
uses: lukka/get-cmake@latest
|
|
with:
|
|
cmakeVersion: 3.24.1
|
|
ninjaVersion: latest
|
|
|
|
- name: Clear ccache
|
|
run: ccache --clear
|
|
|
|
- name: Save and restore ccache keys
|
|
uses: actions/cache@v3
|
|
env:
|
|
cache-name: ccache-maplibre-core
|
|
with:
|
|
path: ~/.ccache
|
|
key: ${{ env.cache-name }}-${{ runner.os }}-${{ github.job }}-${{ github.ref }}-${{ github.sha }}-${{ github.head_ref }}
|
|
# INFO: No fallback restore. Only restoring keys that have the same github reference. Rerunning the same workflow
|
|
# will be faster. New workflow invocation with different code, sha1, or head will not be.
|
|
|
|
- name: Build Maplibre GL Core
|
|
run: |
|
|
cmake --version
|
|
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Debug -DMBGL_WITH_CLANG_TIDY=ON -DMBGL_WITH_CORE_ONLY=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DMBGL_WITH_COVERAGE=ON
|
|
cmake --build build
|