• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#                          __  __            _
2#                       ___\ \/ /_ __   __ _| |_
3#                      / _ \\  /| '_ \ / _` | __|
4#                     |  __//  \| |_) | (_| | |_
5#                      \___/_/\_\ .__/ \__,_|\__|
6#                               |_| XML parser
7#
8# Copyright (c) 2021-2024 Sebastian Pipping <sebastian@pipping.org>
9# Copyright (c) 2023      Joyce Brum <joycebrum@google.com>
10# Copyright (c) 2024      Dag-Erling Smørgrav <des@des.dev>
11# Licensed under the MIT license:
12#
13# Permission is  hereby granted,  free of charge,  to any  person obtaining
14# a  copy  of  this  software   and  associated  documentation  files  (the
15# "Software"),  to  deal in  the  Software  without restriction,  including
16# without  limitation the  rights  to use,  copy,  modify, merge,  publish,
17# distribute, sublicense, and/or sell copies of the Software, and to permit
18# persons  to whom  the Software  is  furnished to  do so,  subject to  the
19# following conditions:
20#
21# The above copyright  notice and this permission notice  shall be included
22# in all copies or substantial portions of the Software.
23#
24# THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
25# EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
26# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
27# NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
28# DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
29# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
30# USE OR OTHER DEALINGS IN THE SOFTWARE.
31
32name: Ensure realistic minimum CMake version requirement
33
34on:
35  pull_request:
36  push:
37  schedule:
38    - cron: '0 2 * * 5'  # Every Friday at 2am
39  workflow_dispatch:
40
41permissions:
42  contents: read
43
44jobs:
45  checks:
46    name: Ensure realistic minimum CMake version requirement
47    runs-on: ubuntu-20.04
48    steps:
49    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683  # v4.2.2
50
51    - name: Install ancient CMake
52      run: |
53        set -ux
54
55        needed_cmake_version="$(sed -n 's/cmake_minimum_required(VERSION \(.*\))/\1/p' expat/CMakeLists.txt)"
56
57        installer_filename="cmake-${needed_cmake_version}-linux-x86_64.sh"
58        download_url="https://github.com/Kitware/CMake/releases/download/v${needed_cmake_version}/${installer_filename}"
59        wget --no-verbose "${download_url}"
60
61        chmod +x "${installer_filename}"
62        mkdir -p ~/.local/
63
64        ./"${installer_filename}" --prefix="${HOME}"/.local/ --skip-license
65
66        hash cmake  # or the running shell will keep using the cached old location
67        present_cmake_version="$(cmake --version | sed -n 's/cmake version \(.*\)/\1/p')"
68        [[ ${present_cmake_version} = ${needed_cmake_version} ]]
69
70    - name: Build libexpat using ancient CMake
71      run: |
72        set -ux
73        mkdir expat/build
74        cd expat/build
75        cmake --version
76        cmake ..
77        make VERBOSE=1 all test install DESTDIR="${PWD}/ROOT/"
78        find ROOT/ -not -type d | sort
79