Skip to content

Commit

Permalink
Land 1135 - CI: improve cmake config workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
botovq committed Jan 11, 2025
2 parents 0d8a436 + b8e4965 commit 2c8bc60
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 89 deletions.
98 changes: 98 additions & 0 deletions .github/workflows/cmake-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# GitHub Actions workflow to check CMake config.
name: "CMake Check"

on:
push: {}
pull_request: {}

concurrency:
group: "${{ github.workflow }}-${{ github.event.number || github.ref }}"
cancel-in-progress: true

jobs:
check:
name: "${{ matrix.os }}"
runs-on: "${{ matrix.os }}"
strategy:
fail-fast: true
matrix:
os: [ "windows-2022", "macos-14", "ubuntu-24.04" ]
defaults:
run:
shell: "bash"
permissions:
contents: read
steps:
- name: "Checkout repository"
uses: actions/checkout@v4

- name: "Setup Windows dependencies"
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
with:
update: true
install: >-
autoconf
automake
diffutils
libtool
gcc
git
patch
perl
- name: "Setup macOS dependencies"
if: runner.os == 'macOS'
run: brew install automake libtool

- name: "Prepare source tree for build (Windows)"
if: runner.os == 'Windows'
shell: "msys2 {0}"
run: ./autogen.sh

- name: "Prepare source tree for build (Unix)"
if: runner.os != 'Windows'
run: ./autogen.sh

- name: "Configure"
run: |
cmake -S . \
-B build \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/../local
- name: "Build"
run: cmake --build build --config Release --verbose

- name: "Install"
run: cmake --install build --config Release

- name: "Consume from the build directory - Configure"
run: |
cmake -S tests/cmake \
-B consumer-build \
-D CMAKE_BUILD_TYPE=Release \
-D LibreSSL_DIR=$GITHUB_WORKSPACE/build
- name: "Consume from the build directory - Build"
run: cmake --build consumer-build --config Release --verbose

- name: "Consume from the install directory (CMAKE_PREFIX_PATH) - Configure"
run: |
cmake -S tests/cmake \
-B consumer-install-prefix \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/../local
- name: "Consume from the install directory (CMAKE_PREFIX_PATH) - Build"
run: cmake --build consumer-install-prefix --config Release --verbose

- name: "Consume from the install directory (LibreSSL_DIR) - Configure"
run: |
cmake -S tests/cmake \
-B consumer-install-dir \
-D CMAKE_BUILD_TYPE=Release \
-D LibreSSL_DIR=$GITHUB_WORKSPACE/../local/lib/cmake/LibreSSL
- name: "Consume from the install directory (LibreSSL_DIR) - Build"
run: cmake --build consumer-install-dir --config Release --verbose
89 changes: 0 additions & 89 deletions .github/workflows/cmake_config.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Makefile.in

# CMake stuff
build
cmake-build-debug/

# Libtool stuff
.libs
Expand Down

0 comments on commit 2c8bc60

Please sign in to comment.