ci: added build workflow
This commit is contained in:
64
.github/workflows/linux.yaml
vendored
Normal file
64
.github/workflows/linux.yaml
vendored
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
name: Linux (Ubuntu-24.04) CI
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
config:
|
||||||
|
- { compiler: gcc, version: 14, std: 23, build_type: Release }
|
||||||
|
- { compiler: clang, version: 20, std: 23, build_type: Release }
|
||||||
|
|
||||||
|
name: "${{matrix.config.compiler}} ${{matrix.config.version}} (C++${{matrix.config.std}}, ${{matrix.config.build_type}})"
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup compiler and build system
|
||||||
|
uses: aminya/setup-cpp@v1
|
||||||
|
with:
|
||||||
|
compiler: ${{ matrix.config.compiler }}-${{ matrix.config.version }}
|
||||||
|
ninja: true
|
||||||
|
|
||||||
|
- name: Setup vcpkg
|
||||||
|
run: |
|
||||||
|
git clone --branch 2025.10.17 --depth 1 https://github.com/microsoft/vcpkg.git && \
|
||||||
|
./vcpkg/bootstrap-vcpkg.sh && \
|
||||||
|
echo 'VCPKG_BINARY_SOURCES=files,${{ github.workspace }}/vcpkg_cache,readwrite' >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Cache vcpkg binaries
|
||||||
|
id: vcpkg-bin-cache
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: vcpkg_cache
|
||||||
|
key: vcpkg-bin-${{ runner.os }}-${{ matrix.config.compiler }}-${{ matrix.config.version }}-${{ matrix.config.build_type }}-${{ hashFiles('**/vcpkg.json') }}
|
||||||
|
|
||||||
|
# Only free up space on dry run
|
||||||
|
# If cache is present (<= 1gb) there is no need to free up space
|
||||||
|
- name: Free Disk Space (Ubuntu)
|
||||||
|
if: steps.vcpkg-bin-cache.outputs.cache-hit != 'true'
|
||||||
|
uses: jlumbroso/free-disk-space@v1.3.1
|
||||||
|
with:
|
||||||
|
tool-cache: false
|
||||||
|
|
||||||
|
- name: Configure and install dependencies and
|
||||||
|
run: |
|
||||||
|
cmake -S . -B build \
|
||||||
|
-DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake \
|
||||||
|
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
|
||||||
|
-DCMAKE_CXX_STANDARD=${{ matrix.config.std }} \
|
||||||
|
-G Ninja
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
cmake --build build -j $(nproc)
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
ctest --exclude-regex static --test-dir build -j $(nproc) --output-on-failure
|
||||||
Reference in New Issue
Block a user