From 7d301a5eba98e859e262b9ec29a94be82bff8997 Mon Sep 17 00:00:00 2001 From: Joshua Kammeraad Date: Wed, 4 Mar 2026 10:12:30 -0500 Subject: [PATCH 1/2] Extract NVHPC and pixi setup into reusable composite action Moves the shared build environment setup (pixi version extraction, pixi install, NVHPC cache, NVHPC install) out of slater-gpu-base.yml and into a reusable composite action at .github/actions/setup-build-env/. This allows downstream repos (e.g. ZEST) to use the same setup with a single 'uses:' line without duplicating infrastructure. Co-Authored-By: Claude Sonnet 4.6 (1M context) --- .github/actions/setup-build-env/action.yml | 57 +++++++++++++++++++ .../setup-build-env}/install_nvhpc.sh | 0 .github/workflows/slater-gpu-base.yml | 44 +------------- 3 files changed, 60 insertions(+), 41 deletions(-) create mode 100644 .github/actions/setup-build-env/action.yml rename .github/{workflows => actions/setup-build-env}/install_nvhpc.sh (100%) diff --git a/.github/actions/setup-build-env/action.yml b/.github/actions/setup-build-env/action.yml new file mode 100644 index 0000000..db44604 --- /dev/null +++ b/.github/actions/setup-build-env/action.yml @@ -0,0 +1,57 @@ +name: Setup Build Environment +description: Sets up NVHPC and pixi for building SlaterGPU and dependent projects + +inputs: + use-latest-pixi: + description: Use latest pixi version instead of the minimum from pixi.toml (for scheduled builds) + required: false + default: 'false' + +runs: + using: composite + steps: + - name: Extract minimum pixi version from pixi.toml + id: pixi-version + if: ${{ inputs.use-latest-pixi != 'true' }} + shell: bash + run: | + VERSION=$(grep 'requires-pixi' pixi.toml | sed 's/.*>=\([0-9.]*\).*/\1/') + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "Minimum pixi version from pixi.toml: $VERSION" + + - name: Set up Pixi (minimum version) + if: ${{ inputs.use-latest-pixi != 'true' }} + uses: prefix-dev/setup-pixi@v0.9.1 + with: + pixi-version: v${{ steps.pixi-version.outputs.version }} + log-level: v + run-install: false + # cache: true + continue-on-error: true + + - name: Set up Pixi (latest version for scheduled builds) + if: ${{ inputs.use-latest-pixi == 'true' }} + uses: prefix-dev/setup-pixi@v0.9.1 + with: + log-level: v + run-install: false + # cache: true + continue-on-error: true + + # Cache NVHPC installation + - name: Cache NVHPC + id: cache-nvhpc + uses: actions/cache@v4 + with: + path: | + /home/runner/work/Linux_x86_64 + /home/runner/work/modulefiles + key: nvhpc-25.1-cuda-12.6-v1-${{ runner.os }} + + - name: Install nvhpc + shell: bash + run: | + source ${{ github.action_path }}/install_nvhpc.sh + env: + CACHE_HIT: ${{ steps.cache-nvhpc.outputs.cache-hit }} + continue-on-error: true \ No newline at end of file diff --git a/.github/workflows/install_nvhpc.sh b/.github/actions/setup-build-env/install_nvhpc.sh similarity index 100% rename from .github/workflows/install_nvhpc.sh rename to .github/actions/setup-build-env/install_nvhpc.sh diff --git a/.github/workflows/slater-gpu-base.yml b/.github/workflows/slater-gpu-base.yml index 77771aa..a33ef9a 100644 --- a/.github/workflows/slater-gpu-base.yml +++ b/.github/workflows/slater-gpu-base.yml @@ -17,48 +17,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Extract minimum pixi version from pixi.toml - id: pixi-version - run: | - VERSION=$(grep 'requires-pixi' pixi.toml | sed 's/.*>=\([0-9.]*\).*/\1/') - echo "version=$VERSION" >> $GITHUB_OUTPUT - echo "Using minimum pixi version: $VERSION" - - - name: Set up Pixi (minimum version) - if: ${{ !inputs.use-latest-pixi }} - uses: prefix-dev/setup-pixi@v0.9.1 - with: - pixi-version: v${{ steps.pixi-version.outputs.version }} - log-level: v - run-install: false - # cache: true - continue-on-error: true - - - name: Set up Pixi (latest version for scheduled builds) - if: ${{ inputs.use-latest-pixi }} - uses: prefix-dev/setup-pixi@v0.9.1 + - name: Setup build environment + uses: ./.github/actions/setup-build-env with: - log-level: v - run-install: false - # cache: true - continue-on-error: true - - # Cache NVHPC installation - - name: Cache NVHPC - id: cache-nvhpc - uses: actions/cache@v4 - with: - path: | - /home/runner/work/Linux_x86_64 - /home/runner/work/modulefiles - key: nvhpc-25.1-cuda-12.6-v1-${{ runner.os }} - - - name: Install nvhpc - run: | - source .github/workflows/install_nvhpc.sh - env: - CACHE_HIT: ${{ steps.cache-nvhpc.outputs.cache-hit }} - continue-on-error: true + use-latest-pixi: ${{ inputs.use-latest-pixi }} - name: Install and test SlaterGPU run: | From 0e6d4b5e212d21db1826deacc6a93d00f0774119 Mon Sep 17 00:00:00 2001 From: Joshua Kammeraad Date: Wed, 4 Mar 2026 10:54:05 -0500 Subject: [PATCH 2/2] Reduce verbosity of pixi commands in CI workflow --- .github/workflows/slater-gpu-base.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/slater-gpu-base.yml b/.github/workflows/slater-gpu-base.yml index a33ef9a..4d8523b 100644 --- a/.github/workflows/slater-gpu-base.yml +++ b/.github/workflows/slater-gpu-base.yml @@ -27,5 +27,5 @@ jobs: source ~/.pixi/envs/environment-modules/init/bash module load ~/work/modulefiles/nvhpc/25.1 module list - pixi -vv install - pixi -vv run test-in-gh-action + pixi -v install + pixi -v run test-in-gh-action