-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
63 lines (58 loc) · 1.91 KB
/
Copy pathaction.yml
File metadata and controls
63 lines (58 loc) · 1.91 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
name: "action-cuda-compiler"
description: "build cuda c++ for ubuntu"
inputs:
cuda:
required: true
description: "Set the cuda version"
gcc:
required: true
description: "Set the gcc version"
action_config:
required: true
description: "Cmake build type"
action_build_dir:
required: true
description: "Directory for cmake build"
action_cmake_path:
required: false
description: "Add path for CMakeLists.txt"
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- name: "Install CUDA"
env:
cuda: ${{ inputs.cuda }}
run: ./scripts/install_cuda_ubuntu.sh
shell: bash
# Specify the correct host compilers
- name: "Install/Select gcc and g++"
shell: bash
run: |
sudo apt-get install -y gcc-${{ inputs.gcc }} g++-${{ inputs.gcc }}
echo "CC=/usr/bin/gcc-${{ inputs.gcc }}" >> $GITHUB_ENV
echo "CXX=/usr/bin/g++-${{ inputs.gcc }}" >> $GITHUB_ENV
echo "CUDAHOSTCXX=/usr/bin/g++-${{ inputs.gcc }}" >> $GITHUB_ENV
- name: "Configure cmake"
id: configure
run: cmake ${{inputs.action_cmake_path}}. -B ${{inputs.action_build_dir}} -DCMAKE_BUILD_TYPE=${{inputs.action_config}}
shell: bash
- name: "Configure Error Processing"
if: ${{ failure() && steps.configure.outcome == 'failure' }}
working-directory: ${{inputs.action_build_dir}}
run: |
if [[ -f "CMakeFiles/CMakeOutput.log" ]]; then
echo "---- CMakeFiles/CMakeOutput.log"
cat CMakeFiles/CMakeOutput.log
echo "----"
fi
if [[ -f "CMakeFiles/CMakeError.log" ]]; then
echo "---- CMakeFiles/CMakeError.log"
cat CMakeFiles/CMakeError.log
echo "----"
fi
shell: bash
- name: "Build everything else"
working-directory: ${{inputs.action_build_dir}}
run: cmake --build . --target all --verbose -j `nproc`
shell: bash