Skip to content

Commit

Permalink
Recompute the job outputs in test instead of reusing
Browse files Browse the repository at this point in the history
the build/test matrices now mismatch, so it's no longer safe to keep the one-to-one relation
  • Loading branch information
leofang committed Dec 16, 2024
1 parent 478acff commit 61813fa
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
5 changes: 1 addition & 4 deletions .github/actions/fetch_ctk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ inputs:
cuda-version:
required: true
type: string
fail-on-ctk-cache-miss:
required: true
type: boolean

runs:
using: composite
Expand All @@ -29,7 +26,7 @@ runs:
with:
key: ${{ env.CTK_CACHE_KEY }}
path: ./${{ env.CTK_CACHE_FILENAME }}
fail-on-cache-miss: ${{ inputs.fail-on-ctk-cache-miss }}
fail-on-cache-miss: false

- name: Get CUDA components
if: ${{ steps.ctk-get-cache.outputs.cache-hit != 'true' }}
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/gh-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ jobs:
(matrix.host-platform == 'win-x64' && 'windows-2019') }}
# (matrix.host-platform == 'win-x64' && 'windows-amd64-cpu8') }}
outputs:
CUDA_CORE_ARTIFACT_NAME: ${{ steps.pass_env.outputs.CUDA_CORE_ARTIFACT_NAME }}
CUDA_CORE_ARTIFACTS_DIR: ${{ steps.pass_env.outputs.CUDA_CORE_ARTIFACTS_DIR }}
CUDA_BINDINGS_ARTIFACT_NAME: ${{ steps.pass_env.outputs.CUDA_BINDINGS_ARTIFACT_NAME }}
CUDA_BINDINGS_ARTIFACTS_DIR: ${{ steps.pass_env.outputs.CUDA_BINDINGS_ARTIFACTS_DIR }}
BUILD_CTK_VER: ${{ steps.pass_env.outputs.CUDA_VERSION }}
steps:
- name: Checkout ${{ github.event.repository.name }}
uses: actions/checkout@v4
Expand Down Expand Up @@ -118,7 +115,6 @@ jobs:
with:
host-platform: ${{ matrix.host-platform }}
cuda-version: ${{ matrix.cuda-version }}
fail-on-ctk-cache-miss: false

- name: Build cuda.bindings wheel
uses: pypa/[email protected]
Expand Down Expand Up @@ -165,10 +161,7 @@ jobs:
- name: Pass environment variables to the next runner
id: pass_env
run: |
echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
echo "CUDA_CORE_ARTIFACTS_DIR=${CUDA_CORE_ARTIFACTS_DIR}" >> $GITHUB_OUTPUT
echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_NAME}" >> $GITHUB_OUTPUT
echo "CUDA_BINDINGS_ARTIFACTS_DIR=${CUDA_BINDINGS_ARTIFACTS_DIR}" >> $GITHUB_OUTPUT
echo "CUDA_VERSION=${{ matrix.cuda-version }}" >> $GITHUB_OUTPUT
test:
strategy:
Expand Down Expand Up @@ -217,14 +210,22 @@ jobs:
with:
fetch-depth: 0

- name: Set up test environment
- name: Set environment variables
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
PYTHON_VERSION_FORMATTED=$(echo '${{ matrix.python-version }}' | tr -d '.')
if [[ "${{ matrix.host-platform }}" == linux* ]]; then
REPO_DIR=$(pwd)
elif [[ "${{ matrix.host-platform }}" == win* ]]; then
PWD=$(pwd)
REPO_DIR=$(cygpath -w $PWD)
fi
# make outputs from the previous job as env vars
echo "CUDA_CORE_ARTIFACT_NAME=${{ needs.build.outputs.CUDA_CORE_ARTIFACT_NAME }}" >> $GITHUB_ENV
echo "CUDA_CORE_ARTIFACTS_DIR=${{ needs.build.outputs.CUDA_CORE_ARTIFACTS_DIR }}" >> $GITHUB_ENV
echo "CUDA_BINDINGS_ARTIFACT_NAME=${{ needs.build.outputs.CUDA_BINDINGS_ARTIFACT_NAME }}" >> $GITHUB_ENV
echo "CUDA_BINDINGS_ARTIFACTS_DIR=${{ needs.build.outputs.CUDA_BINDINGS_ARTIFACTS_DIR }}" >> $GITHUB_ENV
echo "CUDA_CORE_ARTIFACT_NAME=cuda-core-python${PYTHON_VERSION_FORMATTED}-${{ matrix.host-platform }}-${{ github.sha }}" >> $GITHUB_ENV
echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_core/dist")" >> $GITHUB_ENV
echo "CUDA_BINDINGS_ARTIFACT_NAME=cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ needs.build.outputs.BUILD_CTK_VER }}-${{ matrix.host-platform }}-${{ github.sha }}" >> $GITHUB_ENV
echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV
- name: Download bindings build artifacts
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -268,7 +269,6 @@ jobs:
with:
host-platform: ${{ matrix.host-platform }}
cuda-version: ${{ matrix.cuda-version }}
fail-on-ctk-cache-miss: true

- name: Run test / analysis
shell: bash --noprofile --norc -xeuo pipefail {0}
Expand Down

0 comments on commit 61813fa

Please sign in to comment.