-
Notifications
You must be signed in to change notification settings - Fork 6
101 lines (90 loc) · 3.39 KB
/
linux-nvfortran-cmake.yaml
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
name: linux-nvidia-hpc-cmake
on:
push:
branches:
- master
- main
paths-ignore:
- 'AUTHORS.md'
- 'LICENSE.md'
- 'README.md'
pull_request:
paths-ignore:
- 'AUTHORS.md'
- 'LICENSE.md'
- 'README.md'
jobs:
linux-tests:
timeout-minutes: 45
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: ${{ matrix.os }} - ${{ matrix.toolchain.compiler }} - ${{ matrix.build_type }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
toolchain:
- {compiler: nvidia-hpc, version: '24.5'}
include:
- os: ubuntu-22.04
shell: bash
build_type: debug
toolchain: {compiler: nvidia-hpc, version: '24.5'}
spack_compiler: nvhpc@=24.5
spack_os: "ubuntu:22.04"
omp_target: none
- os: ubuntu-22.04
shell: bash
build_type: debug
toolchain: {compiler: nvidia-hpc, version: '24.5'}
spack_compiler: nvhpc@=24.5
spack_os: "ubuntu:22.04"
omp_target: multicore
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}
- name: Show version information
run: |
${{ env.FC }} --version
${{ env.CC }} --version
- name: Set up Spack
uses: spack/setup-spack@v2
- name: Install dependencies in spack environment
run: |
spack -e ./share/spack-env/ mirror set --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" local-buildcache
spack -e ./share/spack-env/ compiler find /opt/nvidia/hpc_sdk/Linux_x86_64/24.5/compilers/bin
spack -e ./share/spack-env/ external find --not-buildable
spack -e ./share/spack-env/ config add packages:feq-parse:require:["'%${{ matrix.spack_compiler }}'"]
spack -e ./share/spack-env/ config add packages:hdf5:require:["'%${{ matrix.spack_compiler }}'"]
spack -e ./share/spack-env/ config add packages:openmpi:require:["'%${{ matrix.spack_compiler }}'"]
spack -e ./share/spack-env/ concretize -f
spack -e ./share/spack-env/ install --no-check-signature
- name: Build with Cmake
shell: spack-bash {0}
run: |
spack env activate ./share/spack-env/
mkdir build
cd build
FC=${{ env.FC }} CC=${{ env.CC }} \
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ../
make VERBOSE=1
- name: Run ctests
run: |
export OMP_NUM_THREADS=4
export OMP_TARGET_OFFLOAD=DISABLED
export WORKSPACE=/home/runner/work/SELF/SELF/
ctest --verbose \
--output-on-failure \
--test-dir ./build/
- name: Push packages and update index
run: |
spack -e ./share/spack-env/ mirror set --push --oci-username ${{ github.actor }} --oci-password "${{ secrets.GITHUB_TOKEN }}" local-buildcache
spack -e ./share/spack-env/ buildcache push --base-image ${{ matrix.spack_os }} --update-index local-buildcache
if: ${{ !cancelled() }}