|
| 1 | +name: Toolchain Full Build Test |
| 2 | +on: |
| 3 | + schedule: |
| 4 | + - cron: "0 0 * * 0" |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + variants: |
| 8 | + description: "Comma-separated variants: gnu,intel,cuda" |
| 9 | + required: false |
| 10 | + default: "gnu,intel,cuda" |
| 11 | +jobs: |
| 12 | + full-build-gnu: |
| 13 | + if: contains(inputs.variants || 'gnu,intel,cuda', 'gnu') |
| 14 | + runs-on: X64 |
| 15 | + container: |
| 16 | + image: ghcr.io/deepmodeling/abacus-gnu |
| 17 | + steps: |
| 18 | + - name: Checkout |
| 19 | + uses: actions/checkout@v6 |
| 20 | + - name: Install requirements |
| 21 | + run: | |
| 22 | + set -euo pipefail |
| 23 | + cd toolchain/root_requirements |
| 24 | + sudo ./install_requirements_ubuntu.sh |
| 25 | + - name: Build toolchain |
| 26 | + run: | |
| 27 | + set -euo pipefail |
| 28 | + cd toolchain |
| 29 | + ./toolchain_gnu.sh |
| 30 | + - name: Build ABACUS |
| 31 | + run: | |
| 32 | + set -euo pipefail |
| 33 | + cd toolchain |
| 34 | + ./build_abacus_gnu.sh |
| 35 | + cd .. |
| 36 | + ./bin/abacus --version || true |
| 37 | + - name: Upload logs |
| 38 | + if: always() |
| 39 | + uses: actions/upload-artifact@v4 |
| 40 | + with: |
| 41 | + name: toolchain-full-gnu |
| 42 | + path: | |
| 43 | + toolchain/compile.log |
| 44 | + toolchain/compile.err |
| 45 | + toolchain/install/setup |
| 46 | + toolchain/build/**/make.log |
| 47 | + toolchain/build/**/configure.log |
| 48 | + toolchain/build/**/cmake.log |
| 49 | + if-no-files-found: ignore |
| 50 | + |
| 51 | + full-build-intel: |
| 52 | + if: contains(inputs.variants || 'gnu,intel,cuda', 'intel') |
| 53 | + runs-on: X64 |
| 54 | + container: |
| 55 | + image: ghcr.io/deepmodeling/abacus-intel |
| 56 | + steps: |
| 57 | + - name: Checkout |
| 58 | + uses: actions/checkout@v6 |
| 59 | + - name: Install requirements |
| 60 | + run: | |
| 61 | + set -euo pipefail |
| 62 | + cd toolchain/root_requirements |
| 63 | + sudo ./install_requirements_ubuntu.sh |
| 64 | + - name: Build toolchain |
| 65 | + run: | |
| 66 | + set -euo pipefail |
| 67 | + cd toolchain |
| 68 | + ./toolchain_intel.sh |
| 69 | + - name: Build ABACUS |
| 70 | + run: | |
| 71 | + set -euo pipefail |
| 72 | + cd toolchain |
| 73 | + ./build_abacus_intel.sh |
| 74 | + cd .. |
| 75 | + ./bin/abacus --version || true |
| 76 | + - name: Upload logs |
| 77 | + if: always() |
| 78 | + uses: actions/upload-artifact@v4 |
| 79 | + with: |
| 80 | + name: toolchain-full-intel |
| 81 | + path: | |
| 82 | + toolchain/compile.log |
| 83 | + toolchain/compile.err |
| 84 | + toolchain/install/setup |
| 85 | + toolchain/build/**/make.log |
| 86 | + toolchain/build/**/configure.log |
| 87 | + toolchain/build/**/cmake.log |
| 88 | + if-no-files-found: ignore |
| 89 | + |
| 90 | + full-build-cuda: |
| 91 | + if: contains(inputs.variants || 'gnu,intel,cuda', 'cuda') |
| 92 | + runs-on: nvidia |
| 93 | + steps: |
| 94 | + - name: Checkout |
| 95 | + uses: actions/checkout@v6 |
| 96 | + - name: Install requirements |
| 97 | + run: | |
| 98 | + set -euo pipefail |
| 99 | + if [ -f /etc/os-release ]; then . /etc/os-release; fi |
| 100 | + if [ "${ID:-}" = "ubuntu" ] || [ "${ID_LIKE:-}" = "debian" ]; then |
| 101 | + sudo ./toolchain/root_requirements/install_requirements_ubuntu.sh |
| 102 | + elif [ "${ID:-}" = "fedora" ] || [ "${ID_LIKE:-}" = "rhel fedora" ]; then |
| 103 | + sudo ./toolchain/root_requirements/install_requirements_fedora.sh |
| 104 | + else |
| 105 | + exit 1 |
| 106 | + fi |
| 107 | + - name: Prepare CUDA and NVHPC |
| 108 | + run: | |
| 109 | + set -euo pipefail |
| 110 | + if command -v nvidia-smi >/dev/null 2>&1; then |
| 111 | + nvidia-smi |
| 112 | + cap="$(nvidia-smi --query-gpu=compute_cap --format=csv,noheader | head -n 1 | tr -d '.' | xargs || true)" |
| 113 | + fi |
| 114 | + if [ -z "${cap:-}" ]; then cap="70"; fi |
| 115 | + echo "GPU_CAP=${cap}" >> "$GITHUB_ENV" |
| 116 | + if command -v module >/dev/null 2>&1; then |
| 117 | + module use /opt/nvidia/hpc_sdk/modulefiles || true |
| 118 | + module load nvhpc/26.1 || module load nvhpc-hpcx-cuda12/25.3 |
| 119 | + else |
| 120 | + exit 1 |
| 121 | + fi |
| 122 | + if [ -d /usr/local/cuda ]; then |
| 123 | + echo "CUDA_PATH=/usr/local/cuda" >> "$GITHUB_ENV" |
| 124 | + fi |
| 125 | + - name: Build toolchain |
| 126 | + run: | |
| 127 | + set -euo pipefail |
| 128 | + cd toolchain |
| 129 | + ./toolchain_gnu.sh --enable-cuda --gpu-ver "${GPU_CAP}" |
| 130 | + - name: Build ABACUS |
| 131 | + run: | |
| 132 | + set -euo pipefail |
| 133 | + cd toolchain |
| 134 | + ./build_abacus_gnu.sh |
| 135 | + cd .. |
| 136 | + ./bin/abacus --version || true |
| 137 | + - name: Upload logs |
| 138 | + if: always() |
| 139 | + uses: actions/upload-artifact@v4 |
| 140 | + with: |
| 141 | + name: toolchain-full-cuda |
| 142 | + path: | |
| 143 | + toolchain/compile.log |
| 144 | + toolchain/compile.err |
| 145 | + toolchain/install/setup |
| 146 | + if-no-files-found: ignore |
0 commit comments