forked from apple/swift-nio
-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (55 loc) · 2.14 KB
/
cmake_tests.yml
File metadata and controls
58 lines (55 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: CMake build
permissions:
contents: read
on:
workflow_call:
inputs:
update_cmake_lists_config:
type: string
description: "The configuration used when updating the CMake lists."
required: true
cmake_build_target_directory:
type: string
description: "The directory to pass to `cmake build`."
default: "."
cmake_version:
type: string
description: "The version of CMake to install."
default: ""
image:
type: string
description: "The docker image to run the checks in."
default: "swift:6.0-jammy"
jobs:
cmake-checks:
name: CMake checks
runs-on: ubuntu-latest
container:
image: ${{ inputs.image }}
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
submodules: true
- name: Mark the workspace as safe
# https://github.com/actions/checkout/issues/766
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Check CMakeLists files
run: |
which curl jq || apt -q update
which curl || apt -yq install curl
which jq || apt -yq install jq
curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/update-cmake-lists.sh | CONFIG_JSON="$INPUT_UPDATE_CMAKE_LISTS_CONFIG" FAIL_ON_CHANGES=true bash
env:
INPUT_UPDATE_CMAKE_LISTS_CONFIG: ${{ inputs.update_cmake_lists_config }}
- name: CMake build
run: |
which curl cmake ninja || apt -q update
which curl || apt -yq install curl
which cmake || apt -yq install cmake
which ninja || apt -yq install ninja-build
curl -s --retry 3 https://raw.githubusercontent.com/apple/swift-nio/main/scripts/cmake-build.sh | TARGET_DIRECTORY="$INPUT_CMAKE_BUILD_TARGET_DIRECTORY" CMAKE_VERSION="$INPUT_CMAKE_VERSION" bash
env:
INPUT_CMAKE_BUILD_TARGET_DIRECTORY: ${{ inputs.cmake_build_target_directory }}
INPUT_CMAKE_VERSION: ${{ inputs.cmake_version }}