Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 35 additions & 47 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CMake on multiple platforms
name: CMake Build

on:
push:
Expand All @@ -16,6 +16,7 @@ jobs:
fail-fast: false

matrix:

include:

- os: ubuntu-latest
Expand All @@ -35,84 +36,71 @@ jobs:

steps:

###################################################
# Checkout
###################################################

- uses: actions/checkout@v4

###################################################
# Linux dependencies
###################################################
###########################################################
# Linux
###########################################################

- name: Install Linux dependencies
- name: Install Linux packages
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
default-libmysqlclient-dev \
pkg-config

###################################################
# Setup compiler (Linux)
###################################################

- name: Set compiler
- name: Configure Linux
if: runner.os == 'Linux'
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
echo "CC={{ matrix.cc }}" >> {{ matrix.cc }}" >> GITHUB_ENV
echo "CXX={{ matrix.cxx }}" >> {{ matrix.cxx }}" >> GITHUB_ENV
cmake \
-B build \
-DCMAKE_BUILD_TYPE=Release

###################################################
# Setup vcpkg (Windows)
###################################################
###########################################################
# Windows
###########################################################

- name: Setup vcpkg
- name: Clone vcpkg
if: runner.os == 'Windows'
uses: lukka/run-vcpkg@v11

###################################################
# Install MySQL (Windows)
###################################################
shell: pwsh
run: |
git clone https://github.com/microsoft/vcpkg.git

- name: Install MySQL
- name: Bootstrap vcpkg
if: runner.os == 'Windows'
shell: pwsh
run: |
vcpkg install libmysql:x64-windows
.\vcpkg\bootstrap-vcpkg.bat

###################################################
# Configure Linux
###################################################

- name: Configure Linux
if: runner.os == 'Linux'
- name: Install MySQL
if: runner.os == 'Windows'
shell: pwsh
run: |
cmake \
-B build \
-DCMAKE_BUILD_TYPE=Release

###################################################
# Configure Windows
###################################################
.\vcpkg\vcpkg.exe install libmysql:x64-windows

- name: Configure Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
cmake `
-B build `
-DCMAKE_BUILD_TYPE=Release `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
-DCMAKE_TOOLCHAIN_FILE="$PWD\vcpkg\scripts\buildsystems\vcpkg.cmake"

###################################################
# Build
###################################################
###########################################################
# Build
###########################################################

- name: Build
run: cmake --build build --config Release

###################################################
# Test
###################################################
###########################################################
# Test
###########################################################

- name: Test
run: ctest --test-dir build --build-config Release
Loading