From 7c5fbee327f7735e1ac5a7cf1a55a292428f0690 Mon Sep 17 00:00:00 2001 From: Alec Scott Date: Tue, 9 Jul 2024 04:46:09 +0200 Subject: [PATCH] Improve organization of CI workflow scripts and pip requirements (#45037) --- .github/dependabot.yml | 3 ++- .github/workflows/{ => bin}/bootstrap-test.sh | 0 .github/workflows/{ => bin}/execute_installer.ps1 | 0 .../{ => bin}/generate_spack_yaml_containerize.sh | 0 .github/workflows/{ => bin}/setup_git.ps1 | 0 .github/workflows/{ => bin}/setup_git.sh | 0 .../workflows/{ => bin}/system_shortcut_check.ps1 | 0 .github/workflows/bootstrap.yml | 3 +-- .github/workflows/build-containers.yml | 2 +- .github/workflows/install_spack.sh | 8 -------- .../{ => requirements}/style/requirements.txt | 0 .github/workflows/unit_tests.yaml | 12 ++++++------ .github/workflows/valid-style.yml | 8 ++++---- 13 files changed, 14 insertions(+), 22 deletions(-) rename .github/workflows/{ => bin}/bootstrap-test.sh (100%) rename .github/workflows/{ => bin}/execute_installer.ps1 (100%) rename .github/workflows/{ => bin}/generate_spack_yaml_containerize.sh (100%) rename .github/workflows/{ => bin}/setup_git.ps1 (100%) rename .github/workflows/{ => bin}/setup_git.sh (100%) rename .github/workflows/{ => bin}/system_shortcut_check.ps1 (100%) delete mode 100755 .github/workflows/install_spack.sh rename .github/workflows/{ => requirements}/style/requirements.txt (100%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a5b42ffcf76..b19c9381ecf 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,6 +12,7 @@ updates: interval: "daily" # Requirements to run style checks - package-ecosystem: "pip" - directory: "/.github/workflows/style" + directories: + - "/.github/workflows/requirements/*" schedule: interval: "daily" diff --git a/.github/workflows/bootstrap-test.sh b/.github/workflows/bin/bootstrap-test.sh similarity index 100% rename from .github/workflows/bootstrap-test.sh rename to .github/workflows/bin/bootstrap-test.sh diff --git a/.github/workflows/execute_installer.ps1 b/.github/workflows/bin/execute_installer.ps1 similarity index 100% rename from .github/workflows/execute_installer.ps1 rename to .github/workflows/bin/execute_installer.ps1 diff --git a/.github/workflows/generate_spack_yaml_containerize.sh b/.github/workflows/bin/generate_spack_yaml_containerize.sh similarity index 100% rename from .github/workflows/generate_spack_yaml_containerize.sh rename to .github/workflows/bin/generate_spack_yaml_containerize.sh diff --git a/.github/workflows/setup_git.ps1 b/.github/workflows/bin/setup_git.ps1 similarity index 100% rename from .github/workflows/setup_git.ps1 rename to .github/workflows/bin/setup_git.ps1 diff --git a/.github/workflows/setup_git.sh b/.github/workflows/bin/setup_git.sh similarity index 100% rename from .github/workflows/setup_git.sh rename to .github/workflows/bin/setup_git.sh diff --git a/.github/workflows/system_shortcut_check.ps1 b/.github/workflows/bin/system_shortcut_check.ps1 similarity index 100% rename from .github/workflows/system_shortcut_check.ps1 rename to .github/workflows/bin/system_shortcut_check.ps1 diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 25e74d38bcd..4002b1b9eaa 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -152,7 +152,7 @@ jobs: not_found=0 old_path="$PATH" export PATH="$ver_dir:$PATH" - ./bin/spack-tmpconfig -b ./.github/workflows/bootstrap-test.sh + ./bin/spack-tmpconfig -b ./.github/workflows/bin/bootstrap-test.sh export PATH="$old_path" fi fi @@ -166,4 +166,3 @@ jobs: source share/spack/setup-env.sh spack -d gpg list tree ~/.spack/bootstrap/store/ - diff --git a/.github/workflows/build-containers.yml b/.github/workflows/build-containers.yml index 05b80978099..a3016f5f387 100644 --- a/.github/workflows/build-containers.yml +++ b/.github/workflows/build-containers.yml @@ -76,7 +76,7 @@ jobs: env: SPACK_YAML_OS: "${{ matrix.dockerfile[2] }}" run: | - .github/workflows/generate_spack_yaml_containerize.sh + .github/workflows/bin/generate_spack_yaml_containerize.sh . share/spack/setup-env.sh mkdir -p dockerfiles/${{ matrix.dockerfile[0] }} spack containerize --last-stage=bootstrap | tee dockerfiles/${{ matrix.dockerfile[0] }}/Dockerfile diff --git a/.github/workflows/install_spack.sh b/.github/workflows/install_spack.sh deleted file mode 100755 index be8ec8af21d..00000000000 --- a/.github/workflows/install_spack.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env sh -. share/spack/setup-env.sh -echo -e "config:\n build_jobs: 2" > etc/spack/config.yaml -spack config add "packages:all:target:[x86_64]" -spack compiler find -spack compiler info apple-clang -spack debug report -spack solve zlib diff --git a/.github/workflows/style/requirements.txt b/.github/workflows/requirements/style/requirements.txt similarity index 100% rename from .github/workflows/style/requirements.txt rename to .github/workflows/requirements/style/requirements.txt diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index d1b385c9e1b..f474b8fcd25 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -72,7 +72,7 @@ jobs: run: | # Need this for the git tests to succeed. git --version - . .github/workflows/setup_git.sh + . .github/workflows/bin/setup_git.sh - name: Bootstrap clingo if: ${{ matrix.concretizer == 'clingo' }} env: @@ -118,7 +118,7 @@ jobs: run: | # Need this for the git tests to succeed. git --version - . .github/workflows/setup_git.sh + . .github/workflows/bin/setup_git.sh - name: Run shell tests env: COVERAGE: true @@ -147,7 +147,7 @@ jobs: git --version git config --global --add safe.directory /__w/spack/spack git fetch --unshallow - . .github/workflows/setup_git.sh + . .github/workflows/bin/setup_git.sh useradd spack-test chown -R spack-test . - name: Run unit tests @@ -178,7 +178,7 @@ jobs: run: | # Need this for the git tests to succeed. git --version - . .github/workflows/setup_git.sh + . .github/workflows/bin/setup_git.sh - name: Run unit tests (full suite with coverage) env: COVERAGE: true @@ -217,7 +217,7 @@ jobs: SPACK_TEST_PARALLEL: 4 run: | git --version - . .github/workflows/setup_git.sh + . .github/workflows/bin/setup_git.sh . share/spack/setup-env.sh $(which spack) bootstrap disable spack-install $(which spack) solve zlib @@ -247,7 +247,7 @@ jobs: python -m pip install --upgrade pip pywin32 setuptools pytest-cov clingo - name: Create local develop run: | - ./.github/workflows/setup_git.ps1 + ./.github/workflows/bin/setup_git.ps1 - name: Unit Test run: | spack unit-test -x --verbose --cov --cov-config=pyproject.toml diff --git a/.github/workflows/valid-style.yml b/.github/workflows/valid-style.yml index d4c600ac2ff..05faab0a8de 100644 --- a/.github/workflows/valid-style.yml +++ b/.github/workflows/valid-style.yml @@ -26,7 +26,7 @@ jobs: - name: Install Python Packages run: | pip install --upgrade pip setuptools - pip install -r .github/workflows/style/requirements.txt + pip install -r .github/workflows/requirements/style/requirements.txt - name: vermin (Spack's Core) run: vermin --backport importlib --backport argparse --violations --backport typing -t=3.6- -vvv lib/spack/spack/ lib/spack/llnl/ bin/ - name: vermin (Repositories) @@ -45,12 +45,12 @@ jobs: - name: Install Python packages run: | pip install --upgrade pip setuptools - pip install -r .github/workflows/style/requirements.txt + pip install -r .github/workflows/requirements/style/requirements.txt - name: Setup git configuration run: | # Need this for the git tests to succeed. git --version - . .github/workflows/setup_git.sh + . .github/workflows/bin/setup_git.sh - name: Run style tests run: | share/spack/qa/run-style-tests @@ -76,7 +76,7 @@ jobs: git --version git config --global --add safe.directory /__w/spack/spack git fetch --unshallow - . .github/workflows/setup_git.sh + . .github/workflows/bin/setup_git.sh useradd spack-test chown -R spack-test . - name: Bootstrap Spack development environment