forked from gromacs/gromacs
-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (114 loc) · 3.98 KB
/
build_cmake.yml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: CMake Build Matrix
on: [push, pull_request]
env:
CMAKE_VERSION: 3.18.4
NINJA_VERSION: 1.10.1
BUILD_TYPE: Release
CCACHE_VERSION: 3.7.7
NINJA_STATUS: "[%f/%t %o/sec] "
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows Latest MSVC", artifact: "Windows-MSVC.7z",
os: windows-2019,
cc: "cl", cxx: "cl",
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat",
gpu_var: "Off",
openmp_var: "Off"
}
- {
name: "macOS Latest Clang", artifact: "macOS.7z",
os: macos-latest,
cc: "clang", cxx: "clang++",
gpu_var: "Off",
openmp_var: "Off"
}
- {
name: "macOS 11 gcc with OpenCL", artifact: "macOS-gcc-OpenCL.7z",
os: macos-11, # Don't upgrade to macOS 12, see Issue #4646
cc: "gcc-10", cxx: "g++-10",
gpu_var: "OpenCL",
openmp_var: "On"
}
env:
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
CI_JOB_ID: ${{ github.sha }} # Tell CMake it's running in CI
OPENMP_VAR: ${{ matrix.config.openmp_var }}
GPU_VAR: ${{ matrix.config.gpu_var }}
ENVIRONMENT_SCRIPT: ${{ matrix.config.environment_script }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Download Ninja and CMake
run: cmake -P .github/scripts/download-ninja-cmake.cmake
- name: Download ccache
id: ccache
shell: cmake -P {0}
run: |
set(ccache_url "https://github.com/cristianadam/ccache/releases/download/v$ENV{CCACHE_VERSION}/${{ runner.os }}.tar.xz")
file(DOWNLOAD "${ccache_url}" ./ccache.tar.xz SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./ccache.tar.xz)
- name: ccache cache files
uses: actions/cache@v4
with:
path: .ccache
key: ${{ matrix.config.name }}-ccache-${{ github.sha }}
restore-keys: |
${{ matrix.config.name }}-ccache-
- name: Configure
run: cmake -P .github/scripts/configure.cmake
- name: Build
run: cmake -P .github/scripts/build.cmake
- name: Run tests
run: cmake -P .github/scripts/test.cmake
build-linux-aarch64:
name: Ubuntu 20.04 ARM64 Clang 10
runs-on: ubuntu-20.04
env:
CC: clang-10
CXX: clang++-10
CI_JOB_ID: ${{ github.sha }} # Tell CMake it's running in CI
OPENMP_VAR: Off
GPU_VAR: Off
steps:
- name: Checkout
uses: actions/checkout@v4
with:
show-progress: false
- name: ccache cache files
id: cache-ccache
uses: actions/cache@v4
with:
path: .ccache
key: ${{ github.job }}-ccache-${{ github.sha }}
restore-keys: ${{ github.job }}-ccache-
- name: Build
uses: uraimo/run-on-arch-action@v2
with:
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ github.token }}
dockerRunArgs: |
--volume "${PWD}:/Gromacs" -e GITHUB_PATH -e RUNNER_OS -e "RUNNER_ARCH=ARM64" -e CMAKE_VERSION -e NINJA_VERSION -e GPU_VAR -e BUILD_TYPE -e OPENMP_VAR -e CC -e CXX -e CI_JOB_ID
install: |
apt-get update -q -y
apt-get install -q -y clang-10 cmake ninja-build ccache git
run: |
set -x
cd /Gromacs
git config --global --add safe.directory /Gromacs
export GITHUB_WORKSPACE=$PWD
export CMAKE_VERSION=3.24.2 # use a newer version that has an aarch64 archive
cmake -P .github/scripts/download-ninja-cmake.cmake
export PATH=$GITHUB_WORKSPACE/cmake-${CMAKE_VERSION}-linux-aarch64/bin:$PATH
cmake -P .github/scripts/configure.cmake
cmake -P .github/scripts/build.cmake
cmake -P .github/scripts/test.cmake