77 runs-on : [self-hosted, python, cuda]
88 strategy : {matrix: {cuda-version: [12]}}
99 steps :
10- - uses : actions/checkout@v6
10+ - uses : actions/checkout@v7
1111 with : {fetch-depth: 0, submodules: recursive}
12- - uses : prefix-dev/rattler-build-action@v0.2.38 # https://github.com/prefix-dev/rattler-build/pull/2484
12+ - uses : prefix-dev/rattler-build-action@v0.2.39
1313 with :
14- recipe-path : recipe.yaml
14+ recipe-path : conda/recipe.yaml
15+ rattler-build-version : v0.80.0
1516 build-args : --experimental --variant cuda_version_major=${{ matrix.cuda-version }}
1617 env :
1718 TESTS_FORCE_GPU : " 1"
1819 test :
19- runs-on : ${{ matrix.os }}-${{ matrix.os == 'ubuntu' && '22.04' || ' latest' }}
20+ runs-on : ${{ matrix.os }}-latest
2021 strategy :
2122 matrix :
2223 python-version : ['3.10', '3.x'] # min & max supported
2324 os : [ubuntu, windows]
2425 steps :
25- - uses : actions/checkout@v6
26+ - uses : actions/checkout@v7
2627 with : {fetch-depth: 0, submodules: recursive}
27- - uses : actions/setup-python@v6
28+ - uses : actions/setup-python@v7
2829 with :
2930 python-version : ${{ matrix.python-version }}
3031 - name : build
@@ -36,29 +37,91 @@ jobs:
3637 run : python -m unittest discover -v -s ./test
3738 env : {PYTHONPATH: ./src/Python}
3839 conda-build :
39- runs-on : ${{ matrix.os }}-${{ matrix.os == 'ubuntu' && '22.04' || 'latest' }}
40+ runs-on : ${{ matrix.os }}-latest
41+ defaults : {run: {shell: 'bash -el {0}'}}
4042 strategy :
4143 matrix :
4244 os : [ubuntu, windows]
4345 cuda-version : [None, 12, 13]
46+ env :
47+ CCACHE_DIR : ${{ github.workspace }}/.ccache
48+ CCACHE_MAXSIZE : 100M
49+ CHANNELS : -c conda-forge -c ccpi
4450 steps :
45- - uses : actions/checkout@v6
51+ - uses : actions/checkout@v7
4652 with : {fetch-depth: 0, submodules: recursive}
47- - if : matrix.os == 'windows' && matrix.cuda-version == 'None'
48- uses : ilammy/msvc-dev-cmd@v1
49- - uses : prefix-dev/rattler-build-action@v0.2.38 # https://github.com/prefix-dev/rattler-build/pull/2484
53+ - name : Cache ccache
54+ uses : actions/cache@v6
5055 with :
51- recipe-path : recipe.yaml
52- build-args : --experimental --variant cuda_version_major=${{ matrix.cuda-version }} ${{ matrix.cuda-version == 'None' && ' ' || '--no-test' }}
53- artifact-name : conda-${{ matrix.os }}-${{ matrix.cuda-version }}
56+ path : ${{ env.CCACHE_DIR }}
57+ key : ccache-${{ runner.os }}-cu${{ matrix.cuda-version }}-${{ hashFiles('conda/recipe.yaml', 'conda/variants.yaml') }}
58+ restore-keys : ccache-${{ runner.os }}-cu${{ matrix.cuda-version }}-
59+ - name : config
60+ id : config
61+ run : |
62+ # avoid "hardlink different from source"
63+ git config --global core.commitGraph false
64+ case ${{ matrix.os }} in
65+ windows)
66+ echo target=win-64 >> $GITHUB_OUTPUT
67+ ;;
68+ *)
69+ echo target=linux-64 >> $GITHUB_OUTPUT
70+ ;;
71+ esac
72+ - uses : prefix-dev/rattler-build-action@v0.2.39
73+ with :
74+ recipe-path : conda/recipe.yaml
75+ rattler-build-version : v0.80.0
76+ # --no-build-id: required for ccache
77+ build-args : >
78+ --experimental --target-platform ${{ steps.config.outputs.target }}
79+ -c conda-forge -c ccpi
80+ --test skip --variant cuda_version_major=${{ matrix.cuda-version }}
81+ --no-build-id
82+ artifact-name : conda-${{ steps.config.outputs.target }}-${{ matrix.cuda-version }}
83+ - if : startsWith(matrix.os, 'ubuntu')
84+ name : check glibc support
85+ env :
86+ GLIBC_MAX : ' 2.28' # see recipe.yaml
87+ run : |
88+ set -euo pipefail
89+ d=$(mktemp -d)
90+ unzip -q output/linux-64/*.conda 'pkg-*' -d "$d"
91+ tar --zstd -xf "$d"/pkg-*.tar.zst -C "$d"
92+ max=$(find "$d" -name '*.so' -type f -exec objdump -T {} + | grep -oE 'GLIBC_[0-9.]+' | sort -Vu | tail -1 || true)
93+ [[ -n "$max" ]] || { echo "FAIL: no GLIBC symbols found in package" >&2; exit 1; }
94+ echo "expected max glibc symbol: GLIBC_${GLIBC_MAX} ; found: $max"
95+ if [[ $(printf '%s\n%s\n' "$GLIBC_MAX" "${max#GLIBC_}" | sort -V | tail -1) != "$GLIBC_MAX" ]] ; then
96+ echo "FAIL: $max > GLIBC_${GLIBC_MAX}" >&2
97+ exit 1
98+ fi
99+ - if : matrix.cuda-version == 'None'
100+ name : test
101+ env :
102+ TMPDIR : ${{ github.workspace }}/.tmp-rattler
103+ run : |
104+ mkdir -p "$TMPDIR"
105+ for pkg in output/*/*.conda; do
106+ echo "::group::$(basename $pkg)"
107+ rattler-build test -p "$pkg" -c ./output $CHANNELS
108+ echo "::endgroup::"
109+ done
110+ - if : failure()
111+ name : Upload debug build logs
112+ uses : actions/upload-artifact@v7
113+ with :
114+ name : conda-build-logs-cu${{ matrix.cuda-version }}-${{ matrix.os }}
115+ path : output/bld
116+ retention-days : 7
54117 conda-upload :
55118 if : github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags')
56119 defaults : {run: {working-directory: output}}
57120 runs-on : ubuntu-slim
58121 needs : conda-build
59122 steps :
60- - uses : actions/checkout@v6
61- - uses : prefix-dev/rattler-build-action@v0.2.37
123+ - uses : actions/checkout@v7
124+ - uses : prefix-dev/rattler-build-action@v0.2.39
62125 with : {setup-only: true}
63126 - uses : actions/download-artifact@v8
64127 with : {pattern: conda-*, path: output, merge-multiple: true}
0 commit comments