From a171c8a0870946f4516adeeed0f6104374be7a78 Mon Sep 17 00:00:00 2001 From: Shang Chieh Tseng Date: Thu, 30 Oct 2025 12:07:28 +0800 Subject: [PATCH] Fix test workflows to use build artifacts instead of local binary - Build workflow now uploads ollama binary as artifact with 7-day retention - Test workflows download artifact instead of expecting local binary - Eliminates 'ollama binary not found' error when running tests - Enables build-once, test-multiple-times workflow pattern - Added binary verification step to confirm artifact download --- .github/workflows/tesla-k80-ci.yml | 12 ++++++++++++ .github/workflows/tesla-k80-multi-gpu-tests.yml | 16 ++++++++++------ .github/workflows/tesla-k80-single-gpu-tests.yml | 14 +++++++++----- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tesla-k80-ci.yml b/.github/workflows/tesla-k80-ci.yml index 9f1f6cfc..dc14e9b8 100644 --- a/.github/workflows/tesla-k80-ci.yml +++ b/.github/workflows/tesla-k80-ci.yml @@ -37,3 +37,15 @@ jobs: - name: Build Go binary run: | go build -v -o ollama . + + - name: Verify binary was created + run: | + ls -lh ollama + ./ollama --version + + - name: Upload ollama binary as artifact + uses: actions/upload-artifact@v4 + with: + name: ollama-binary + path: ollama + retention-days: 7 diff --git a/.github/workflows/tesla-k80-multi-gpu-tests.yml b/.github/workflows/tesla-k80-multi-gpu-tests.yml index f85a728e..e1256570 100644 --- a/.github/workflows/tesla-k80-multi-gpu-tests.yml +++ b/.github/workflows/tesla-k80-multi-gpu-tests.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: # Manual trigger only schedule: # Run weekly on Sundays at 2 AM UTC (less frequent than single-GPU tests) - - cron: '0 2 * * 0' + - cron: "0 2 * * 0" jobs: multi-gpu-test: @@ -16,13 +16,17 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Verify ollama binary exists + - name: Download ollama binary from build workflow + uses: actions/download-artifact@v4 + with: + name: ollama-binary + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Make ollama binary executable run: | - if [ ! -f ./ollama ]; then - echo "Error: ollama binary not found. Please run the build workflow first." - exit 1 - fi + chmod +x ollama ls -lh ollama + ./ollama --version - name: Verify multi-GPU setup run: | diff --git a/.github/workflows/tesla-k80-single-gpu-tests.yml b/.github/workflows/tesla-k80-single-gpu-tests.yml index 5f272adb..270ae097 100644 --- a/.github/workflows/tesla-k80-single-gpu-tests.yml +++ b/.github/workflows/tesla-k80-single-gpu-tests.yml @@ -13,13 +13,17 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Verify ollama binary exists + - name: Download ollama binary from build workflow + uses: actions/download-artifact@v4 + with: + name: ollama-binary + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Make ollama binary executable run: | - if [ ! -f ./ollama ]; then - echo "Error: ollama binary not found. Please run the build workflow first." - exit 1 - fi + chmod +x ollama ls -lh ollama + ./ollama --version - name: Build test-runner run: |