Files
Rediska/.github/workflows/linux.yaml
Nikita Astafyev bb057cb244
Some checks failed
Code Analysis / analysis (push) Failing after 1m48s
Linux (Ubuntu-24.04) CI / gcc 14 (C++23, Release) (push) Failing after 3m15s
Linux (Ubuntu-24.04) CI / clang 20 (C++23, Release) (push) Has been cancelled
ci: added build workflow
2025-12-30 22:44:09 +07:00

65 lines
2.1 KiB
YAML

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