From 7a9c5f18b56850ab53d76740d0a3710a7907746b Mon Sep 17 00:00:00 2001 From: Joshua Sing Date: Sat, 11 Jan 2025 20:25:23 +1100 Subject: [PATCH 1/2] ci: improve cmake config workflow --- .github/workflows/cmake-config.yml | 98 ++++++++++++++++++++++++++++++ .github/workflows/cmake_config.yml | 89 --------------------------- .gitignore | 1 + 3 files changed, 99 insertions(+), 89 deletions(-) create mode 100644 .github/workflows/cmake-config.yml delete mode 100644 .github/workflows/cmake_config.yml diff --git a/.github/workflows/cmake-config.yml b/.github/workflows/cmake-config.yml new file mode 100644 index 0000000000..3858773126 --- /dev/null +++ b/.github/workflows/cmake-config.yml @@ -0,0 +1,98 @@ +# GitHub Actions workflow to test CMake config. +name: "CMake Config" + +on: + push: {} + pull_request: {} + +concurrency: + group: "${{ github.workflow }}-${{ github.event.number || github.ref }}" + cancel-in-progress: true + +jobs: + check: + name: "Check (${{ 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 diff --git a/.github/workflows/cmake_config.yml b/.github/workflows/cmake_config.yml deleted file mode 100644 index f22622ccef..0000000000 --- a/.github/workflows/cmake_config.yml +++ /dev/null @@ -1,89 +0,0 @@ -name: cmake_config - -on: [push, pull_request] - -concurrency: - group: "${{ github.workflow }}-${{ github.event.number || github.ref }}" - cancel-in-progress: true - -jobs: - cmake-check: - defaults: - run: - shell: bash - strategy: - matrix: - os: [windows-latest, macos-latest, ubuntu-24.04] - runs-on: ${{ matrix.os }} - continue-on-error: false - name: ${{ matrix.os }} - steps: - - 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 - - - uses: actions/checkout@v4 - - - name: Prepare source tree for build (Windows) - if: runner.os == 'Windows' - run: ./autogen.sh - shell: msys2 {0} - - - 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 diff --git a/.gitignore b/.gitignore index 58172a13d8..9a562e70c1 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ Makefile.in # CMake stuff build +cmake-build-debug/ # Libtool stuff .libs From b8e4965e549c0c081c99ad6498174b0064c24448 Mon Sep 17 00:00:00 2001 From: Joshua Sing Date: Sat, 11 Jan 2025 23:00:48 +1100 Subject: [PATCH 2/2] ci: change cmake workflow name to match others --- .github/workflows/cmake-config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake-config.yml b/.github/workflows/cmake-config.yml index 3858773126..0988102b9f 100644 --- a/.github/workflows/cmake-config.yml +++ b/.github/workflows/cmake-config.yml @@ -1,5 +1,5 @@ -# GitHub Actions workflow to test CMake config. -name: "CMake Config" +# GitHub Actions workflow to check CMake config. +name: "CMake Check" on: push: {} @@ -11,7 +11,7 @@ concurrency: jobs: check: - name: "Check (${{ matrix.os }})" + name: "${{ matrix.os }}" runs-on: "${{ matrix.os }}" strategy: fail-fast: true