-
Notifications
You must be signed in to change notification settings - Fork 6
154 lines (134 loc) · 4.39 KB
/
test.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: build
on: [push, pull_request]
jobs:
docker-build-and-test:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
name: Build and Test - ${{ matrix.dockerfile }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
dockerfile:
- Dockerfile
- Dockerfile.coverage
- Dockerfile.llvm
- Dockerfile.memcheck
- Dockerfile.no_json
- Dockerfile.nvhpc
- Dockerfile.openmp
# - Dockerfile.intel # intel image is too large for GH action
# - Dockerfile.mpi
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build Docker image
run: docker build -t micm -f docker/${{ matrix.dockerfile }} .
- name: Run tests in container
if: matrix.dockerfile != 'Dockerfile.coverage'
run: docker run --name test-container -t micm bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'
- name: Run coverage tests in container
if: matrix.dockerfile == 'Dockerfile.coverage'
run: docker run --name test-container -t micm bash -c 'make coverage ARGS="--rerun-failed --output-on-failure -j8"'
- name: Copy coverage from container
if: matrix.dockerfile == 'Dockerfile.coverage'
run: docker cp test-container:build/coverage.info .
- name: Upload coverage report
if: matrix.dockerfile == 'Dockerfile.coverage'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.info
multiplatform:
if: github.event_name == 'pull_request'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
compiler:
- { cpp: g++, c: gcc}
- { cpp: clang++, c: clang}
- { cpp: cl, c: cl }
exclude:
- os: windows-latest
compiler: { cpp: clang++, c: clang }
- os: windows-latest
compiler: { cpp: g++, c: gcc }
- os: ubuntu-latest
compiler: { cpp: cl, c: cl }
- os: macos-latest
compiler: { cpp: cl, c: cl }
env:
CC: ${{ matrix.compiler.c }}
CXX: ${{ matrix.compiler.cpp }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install CMake
if: matrix.os == 'windows-latest'
run: choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
- name: Install CMake
if: matrix.os != 'windows-latest'
run: |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
sudo apt-get update
sudo apt-get install -y cmake
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
brew install cmake
fi
- name: Configure and build
run: |
mkdir build
cd build
cmake ..
cmake --build . --parallel 10
- name: Run tests
run: |
cd build
ctest -C Debug --rerun-failed --output-on-failure . --verbose
xcode_1:
if: github.event_name == 'pull_request'
runs-on: macos-12
strategy:
matrix:
xcode: ['13.1', '13.2.1', '13.3.1', '13.4.1', '14.0', '14.0.1', '14.1']
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
steps:
- uses: actions/checkout@v3
- name: Configure and build
run: |
mkdir build
cd build
cmake ..
cmake --build . --parallel 10
- name: Run tests
run: |
cd build
ctest --rerun-failed --output-on-failure . --verbose -j 10
xcode_2:
if: github.event_name == 'pull_request'
runs-on: macos-13
strategy:
matrix:
xcode: ['14.1', '14.2', '14.3.1', '15.0']
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
steps:
- uses: actions/checkout@v3
- name: Configure and build
run: |
mkdir build
cd build
cmake ..
cmake --build . --parallel 10
- name: Run tests
run: |
cd build
ctest --rerun-failed --output-on-failure . --verbose -j 10