-
Notifications
You must be signed in to change notification settings - Fork 18
107 lines (105 loc) · 3.54 KB
/
cpuarch.yml
File metadata and controls
107 lines (105 loc) · 3.54 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
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
name: CPU Compilation/Unit Tests
on:
push:
jobs:
check-commit:
runs-on: ubuntu-24.04
outputs:
run_tests: ${{ steps.check_message.outputs.run_tests }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check commit message
id: check_message
run: |
if git log -1 --pretty=%B | grep -q "CPUTEST"; then
echo "run_tests=true" >> "$GITHUB_OUTPUT"
else
echo "run_tests=false" >> "$GITHUB_OUTPUT"
fi
tests:
needs: check-commit
if: needs.check-commit.outputs.run_tests == 'true'
name: UNIT_TESTS (precision=${{ matrix.precision }}, mpi=${{ matrix.mpi }}, output=${{ matrix.output }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
precision: [single, double]
mpi: [ON, OFF]
output: [ON, OFF]
exclude:
- precision: single
mpi: ON
output: ON
- precision: double
mpi: ON
output: ON
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install GCC 14 and build tools
run: |
sudo apt-get update
sudo apt-get install -y gcc-14 g++-14 gfortran-14 build-essential wget libevent-dev libhwloc-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 50
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-14 50
gcc --version
g++ --version
- name: Install CMake (3.x)
run: |
sudo apt-get install -y cmake
cmake --version
- name: Install OpenMPI 5
run: |
sudo apt-get install -y libopenmpi-dev openmpi-bin
mpirun --version
- name: Configure
run: |
if [ "${{ matrix.mpi }}" = "ON" ]; then
export CC=mpicc
export CXX=mpicxx
else
export CC=gcc-14
export CXX=g++-14
fi
cmake -B build -D TESTS=ON -D precision=${{ matrix.precision }} -D mpi=${{ matrix.mpi }} -D output=${{ matrix.output }}
- name: Compile
run: cmake --build build -j "$(nproc)"
- name: Run tests
run: ctest --test-dir build --output-on-failure
pgens:
needs: check-commit
if: needs.check-commit.outputs.run_tests == 'true'
name: PGENS (pgen=${{ matrix.pgen }})
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
pgen: [streaming, turbulence, reconnection, shock, magnetosphere, accretion, wald]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install GCC 14 and build tools
run: |
sudo apt-get update
sudo apt-get install -y gcc-14 g++-14 gfortran-14 build-essential wget libevent-dev libhwloc-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 50
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-14 50
gcc --version
g++ --version
- name: Install CMake (3.x)
run: |
sudo apt-get install -y cmake
cmake --version
- name: Configure
run: |
cmake -B build -D pgen=${{ matrix.pgen }} -D output=OFF
- name: Compile
run: cmake --build build -j "$(nproc)"