Skip to content

Commit a9f5699

Browse files
committed
fix excute tests env
1 parent c131403 commit a9f5699

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/unit_tests_common.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,20 @@ jobs:
229229
- name: Execute Tests
230230
if: steps.should_run.outputs.should_run == 'true'
231231
working-directory: ${{ github.workspace }}
232+
env:
233+
PLATFORM: ${{ inputs.platform }}
232234
run: |
233235
set -euo pipefail
236+
237+
# Activate conda environment based on platform
238+
if [[ "$PLATFORM" == "cuda" ]]; then
239+
source /opt/miniconda3/etc/profile.d/conda.sh
240+
conda activate flagscale-train
241+
elif [[ "$PLATFORM" == "metax" ]] && [ -f /opt/conda/etc/profile.d/conda.sh ]; then
242+
source /opt/conda/etc/profile.d/conda.sh
243+
conda activate base
244+
fi
245+
234246
${{ inputs.setup_commands }}
235247
236248
# Load platform-specific environment variables
@@ -247,6 +259,8 @@ jobs:
247259
export PYTHONPATH=$GITHUB_WORKSPACE:${PYTHONPATH:-}
248260
export PATH=${CUDA_HOME:-/usr/local/cuda}/bin:$PATH
249261
export LD_LIBRARY_PATH=${CUDA_HOME:-/usr/local/cuda}/lib:${LD_LIBRARY_PATH:-}
262+
# Ensure log directory exists regardless of volume mount state
263+
mkdir -p /logs
250264
251265
if [[ "${{ matrix.test_group.name }}" == *"lint"* ]]; then
252266
export CPP_ONLY=0

0 commit comments

Comments
 (0)