From 7c5fbee327f7735e1ac5a7cf1a55a292428f0690 Mon Sep 17 00:00:00 2001 From: Alec Scott Date: Tue, 9 Jul 2024 04:46:09 +0200 Subject: Improve organization of CI workflow scripts and pip requirements (#45037) --- .github/workflows/bin/bootstrap-test.sh | 8 ++++++++ .github/workflows/bin/execute_installer.ps1 | 7 +++++++ .github/workflows/bin/generate_spack_yaml_containerize.sh | 9 +++++++++ .github/workflows/bin/setup_git.ps1 | 10 ++++++++++ .github/workflows/bin/setup_git.sh | 8 ++++++++ .github/workflows/bin/system_shortcut_check.ps1 | 4 ++++ 6 files changed, 46 insertions(+) create mode 100755 .github/workflows/bin/bootstrap-test.sh create mode 100644 .github/workflows/bin/execute_installer.ps1 create mode 100755 .github/workflows/bin/generate_spack_yaml_containerize.sh create mode 100644 .github/workflows/bin/setup_git.ps1 create mode 100755 .github/workflows/bin/setup_git.sh create mode 100644 .github/workflows/bin/system_shortcut_check.ps1 (limited to '.github/workflows/bin') diff --git a/.github/workflows/bin/bootstrap-test.sh b/.github/workflows/bin/bootstrap-test.sh new file mode 100755 index 0000000000..563eb28643 --- /dev/null +++ b/.github/workflows/bin/bootstrap-test.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e +source share/spack/setup-env.sh +$PYTHON bin/spack bootstrap disable github-actions-v0.4 +$PYTHON bin/spack bootstrap disable spack-install +$PYTHON bin/spack $SPACK_FLAGS solve zlib +tree $BOOTSTRAP/store +exit 0 diff --git a/.github/workflows/bin/execute_installer.ps1 b/.github/workflows/bin/execute_installer.ps1 new file mode 100644 index 0000000000..9d9f5cfbeb --- /dev/null +++ b/.github/workflows/bin/execute_installer.ps1 @@ -0,0 +1,7 @@ +$ proc = Start-Process ${{ env.spack_installer }}\spack.exe "/install /quiet" -Passthru +$handle = $proc.Handle # cache proc.Handle +$proc.WaitForExit(); + +if ($proc.ExitCode -ne 0) { + Write-Warning "$_ exited with status code $($proc.ExitCode)" +} diff --git a/.github/workflows/bin/generate_spack_yaml_containerize.sh b/.github/workflows/bin/generate_spack_yaml_containerize.sh new file mode 100755 index 0000000000..2a180b7dd1 --- /dev/null +++ b/.github/workflows/bin/generate_spack_yaml_containerize.sh @@ -0,0 +1,9 @@ +#!/bin/bash + (echo "spack:" \ +&& echo " specs: []" \ +&& echo " container:" \ +&& echo " format: docker" \ +&& echo " images:" \ +&& echo " os: \"${SPACK_YAML_OS}\"" \ +&& echo " spack:" \ +&& echo " ref: ${GITHUB_REF}") > spack.yaml diff --git a/.github/workflows/bin/setup_git.ps1 b/.github/workflows/bin/setup_git.ps1 new file mode 100644 index 0000000000..836b7f8a2c --- /dev/null +++ b/.github/workflows/bin/setup_git.ps1 @@ -0,0 +1,10 @@ +# (c) 2022 Lawrence Livermore National Laboratory + +git config --global user.email "spack@example.com" +git config --global user.name "Test User" +git config --global core.longpaths true + +if ($(git branch --show-current) -ne "develop") +{ + git branch develop origin/develop +} diff --git a/.github/workflows/bin/setup_git.sh b/.github/workflows/bin/setup_git.sh new file mode 100755 index 0000000000..4eb416720b --- /dev/null +++ b/.github/workflows/bin/setup_git.sh @@ -0,0 +1,8 @@ +#!/bin/bash -e +git config --global user.email "spack@example.com" +git config --global user.name "Test User" + +# create a local pr base branch +if [[ -n $GITHUB_BASE_REF ]]; then + git fetch origin "${GITHUB_BASE_REF}:${GITHUB_BASE_REF}" +fi diff --git a/.github/workflows/bin/system_shortcut_check.ps1 b/.github/workflows/bin/system_shortcut_check.ps1 new file mode 100644 index 0000000000..03b3a236f1 --- /dev/null +++ b/.github/workflows/bin/system_shortcut_check.ps1 @@ -0,0 +1,4 @@ +param ($systemFolder, $shortcut) + +$start = [System.Environment]::GetFolderPath("$systemFolder") +Invoke-Item "$start\Programs\Spack\$shortcut" -- cgit v1.2.3-70-g09d2