Silence warnings about non-existent index for mirrors that don't have and don't need a buildcache index #1869
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: unit tests | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| - releases/** | |
| - spack-stack-dev | |
| - release/** | |
| pull_request: | |
| branches: | |
| - develop | |
| - releases/** | |
| - spack-stack-dev | |
| - release/** | |
| workflow_dispatch: | |
| workflow_call: | |
| concurrency: | |
| group: unit_tests-${{github.ref}}-${{github.event.pull_request.number || github.run_number}} | |
| cancel-in-progress: true | |
| jobs: | |
| # Run unit tests with different configurations on linux | |
| ubuntu: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| python-version: ['3.8', '3.9', '3.10', '3.11', '3.14'] | |
| on_develop: | |
| - ${{ github.ref == 'refs/heads/develop' }} | |
| include: | |
| - python-version: '3.7' | |
| os: ubuntu-22.04 | |
| on_develop: ${{ github.ref == 'refs/heads/develop' }} | |
| exclude: | |
| - python-version: '3.8' | |
| os: ubuntu-latest | |
| on_develop: false | |
| - python-version: '3.9' | |
| os: ubuntu-latest | |
| on_develop: false | |
| - python-version: '3.10' | |
| os: ubuntu-latest | |
| on_develop: false | |
| - python-version: '3.11' | |
| os: ubuntu-latest | |
| on_develop: false | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| fetch-depth: 0 | |
| - name: Revert spack-stack modifications | |
| run: ./REMOVE_SPACK_STACK_MODS_FOR_CI.sh | |
| - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install System packages | |
| run: | | |
| sudo apt-get -y update | |
| # Needed for unit tests | |
| sudo apt-get -y install \ | |
| coreutils cvs gfortran graphviz gnupg2 mercurial ninja-build \ | |
| cmake bison libbison-dev subversion | |
| # On ubuntu 24.04, kcov was removed. It may come back in some future Ubuntu | |
| - name: Set up Homebrew | |
| id: set-up-homebrew | |
| uses: Homebrew/actions/setup-homebrew@40e9946c182a64b3db1bf51be0dcb915f7802aa9 | |
| - name: Install kcov with brew | |
| run: "brew install kcov" | |
| - name: Install Python packages | |
| run: | | |
| # See https://github.com/coveragepy/coveragepy/issues/2082 | |
| pip install --upgrade pip pytest pytest-xdist pytest-cov "coverage<=7.11.0" | |
| pip install --upgrade flake8 "isort>=4.3.5" "mypy>=0.900" "click" "black" | |
| - name: Setup git configuration | |
| run: | | |
| # Need this for the git tests to succeed. | |
| git --version | |
| . .github/workflows/bin/setup_git.sh | |
| - name: Bootstrap clingo | |
| if: ${{ matrix.concretizer == 'clingo' }} | |
| env: | |
| SPACK_PYTHON: python | |
| run: | | |
| . share/spack/setup-env.sh | |
| spack bootstrap disable spack-install | |
| spack bootstrap now | |
| spack -v solve zlib | |
| - name: Run unit tests | |
| env: | |
| SPACK_PYTHON: python | |
| SPACK_TEST_PARALLEL: 4 | |
| COVERAGE: true | |
| COVERAGE_FILE: coverage/.coverage-${{ matrix.os }}-python${{ matrix.python-version }} | |
| UNIT_TEST_COVERAGE: ${{ matrix.python-version == '3.14' }} | |
| run: | | |
| share/spack/qa/run-unit-tests | |
| - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b | |
| with: | |
| name: coverage-${{ matrix.os }}-python${{ matrix.python-version }} | |
| path: coverage | |
| include-hidden-files: true | |
| # Test shell integration | |
| shell: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| fetch-depth: 0 | |
| - name: Revert spack-stack modifications | |
| run: ./REMOVE_SPACK_STACK_MODS_FOR_CI.sh | |
| - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b | |
| with: | |
| python-version: '3.11' | |
| - name: Install System packages | |
| run: | | |
| sudo apt-get -y update | |
| # Needed for shell tests | |
| sudo apt-get install -y coreutils csh zsh tcsh fish dash bash subversion | |
| # On ubuntu 24.04, kcov was removed. It may come back in some future Ubuntu | |
| - name: Set up Homebrew | |
| id: set-up-homebrew | |
| uses: Homebrew/actions/setup-homebrew@40e9946c182a64b3db1bf51be0dcb915f7802aa9 | |
| - name: Install kcov with brew | |
| run: "brew install kcov" | |
| - name: Install Python packages | |
| run: | | |
| pip install --upgrade pip pytest coverage[toml] pytest-xdist | |
| - name: Setup git configuration | |
| run: | | |
| # Need this for the git tests to succeed. | |
| git --version | |
| . .github/workflows/bin/setup_git.sh | |
| - name: Run shell tests | |
| env: | |
| COVERAGE: true | |
| run: | | |
| share/spack/qa/run-shell-tests | |
| - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b | |
| with: | |
| name: coverage-shell | |
| path: coverage | |
| include-hidden-files: true | |
| # Test RHEL8 UBI with platform Python. This job is run | |
| # only on PRs modifying core Spack | |
| rhel8-platform-python: | |
| runs-on: ubuntu-latest | |
| container: registry.access.redhat.com/ubi8/ubi | |
| steps: | |
| - name: Install dependencies | |
| run: | | |
| dnf install -y \ | |
| bzip2 curl gcc-c++ gcc gcc-gfortran git gnupg2 gzip \ | |
| make patch tcl unzip which xz | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| - name: Revert spack-stack modifications | |
| run: ./REMOVE_SPACK_STACK_MODS_FOR_CI.sh | |
| - name: Setup repo and non-root user | |
| run: | | |
| git --version | |
| git config --global --add safe.directory '*' | |
| git fetch --unshallow | |
| . .github/workflows/bin/setup_git.sh | |
| - name: Setup a virtual environment with platform-python | |
| run: | | |
| /usr/libexec/platform-python -m venv ~/platform-spack | |
| source ~/platform-spack/bin/activate | |
| pip install --upgrade pip pytest coverage[toml] pytest-xdist | |
| - name: Bootstrap Spack development environment and run unit tests | |
| run: | | |
| source ~/platform-spack/bin/activate | |
| source share/spack/setup-env.sh | |
| spack debug report | |
| spack -d bootstrap now --dev | |
| pytest --verbose -x -n3 --dist loadfile -k 'not cvs and not svn and not hg' | |
| # Test for the clingo based solver (using clingo-cffi) | |
| clingo-cffi: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| fetch-depth: 0 | |
| - name: Revert spack-stack modifications | |
| run: ./REMOVE_SPACK_STACK_MODS_FOR_CI.sh | |
| - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b | |
| with: | |
| python-version: '3.13' | |
| - name: Install System packages | |
| run: | | |
| sudo apt-get -y update | |
| sudo apt-get -y install coreutils gfortran graphviz gnupg2 | |
| - name: Install Python packages | |
| run: | | |
| pip install --upgrade pip pytest coverage[toml] pytest-cov clingo pytest-xdist | |
| pip install --upgrade flake8 "isort>=4.3.5" "mypy>=0.900" "click" "black" | |
| - name: Run unit tests (full suite with coverage) | |
| env: | |
| COVERAGE: true | |
| COVERAGE_FILE: coverage/.coverage-clingo-cffi | |
| run: | | |
| . share/spack/setup-env.sh | |
| spack bootstrap disable spack-install | |
| spack bootstrap disable github-actions-v0.6 | |
| spack bootstrap disable github-actions-v2 | |
| spack bootstrap status | |
| spack solve zlib | |
| pytest --verbose --cov --cov-config=pyproject.toml --cov-report=xml:coverage.xml -x -n3 lib/spack/spack/test/concretization/core.py | |
| - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b | |
| with: | |
| name: coverage-clingo-cffi | |
| path: coverage | |
| include-hidden-files: true | |
| # Run unit tests on MacOS | |
| macos: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-15-intel, macos-latest] | |
| python-version: ["3.14"] | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| fetch-depth: 0 | |
| - name: Revert spack-stack modifications | |
| run: ./REMOVE_SPACK_STACK_MODS_FOR_CI.sh | |
| - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Python packages | |
| run: | | |
| pip install --upgrade pip | |
| # See https://github.com/coveragepy/coveragepy/issues/2082 | |
| pip install --upgrade pytest coverage[toml] pytest-xdist pytest-cov "coverage<=7.11.0" | |
| - name: Setup Homebrew packages | |
| run: | | |
| brew install dash fish gcc gnupg kcov | |
| - name: Run unit tests | |
| env: | |
| COVERAGE_FILE: coverage/.coverage-${{ matrix.os }}-python${{ matrix.python-version }} | |
| run: | | |
| git --version | |
| . .github/workflows/bin/setup_git.sh | |
| . share/spack/setup-env.sh | |
| spack bootstrap disable spack-install | |
| spack solve zlib | |
| python3 -m pytest --verbose --cov --cov-config=pyproject.toml --cov-report=xml:coverage.xml --dist loadfile -x -n4 | |
| - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b | |
| with: | |
| name: coverage-${{ matrix.os }}-python${{ matrix.python-version }} | |
| path: coverage | |
| include-hidden-files: true | |
| # Run unit tests on Windows | |
| windows: | |
| # Don't run this on other repos than spack/spack | |
| if: github.repository == 'spack/spack' | |
| defaults: | |
| run: | |
| shell: | |
| powershell Invoke-Expression -Command "./share/spack/qa/windows_test_setup.ps1"; {0} | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| fetch-depth: 0 | |
| - name: Revert spack-stack modifications | |
| run: ./REMOVE_SPACK_STACK_MODS_FOR_CI.sh | |
| - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b | |
| with: | |
| python-version: '3.14' | |
| - name: Install Python packages | |
| run: | | |
| python -m pip install --upgrade pip pywin32 pytest-cov clingo "coverage<=7.11.0" | |
| - name: Create local develop | |
| run: | | |
| ./.github/workflows/bin/setup_git.ps1 | |
| - name: Unit Test | |
| env: | |
| COVERAGE_FILE: coverage/.coverage-windows | |
| run: | | |
| python -m pytest -x --verbose --cov --cov-config=pyproject.toml | |
| ./share/spack/qa/validate_last_exit.ps1 | |
| - uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b | |
| with: | |
| name: coverage-windows | |
| path: coverage | |
| include-hidden-files: true | |
| canonicalization: | |
| # Don't run this on other repos than spack/spack | |
| if: github.repository == 'spack/spack' | |
| name: package.py canonicalization | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/spack/all-pythons:2025-10-10 | |
| steps: | |
| - name: Checkout Spack (current) | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| path: spack-current | |
| - name: Checkout Spack (previous) | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| path: spack-previous | |
| ref: ${{ github.event.pull_request.base.sha || github.event.before }} | |
| - name: Checkout Spack Packages | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
| with: | |
| repository: spack/spack-packages | |
| path: spack-packages | |
| - name: Test package.py canonicalization | |
| run: spack-current/.github/workflows/bin/canonicalize.py | |
| --spack $PWD/spack-previous $PWD/spack-current | |
| --python python3.6 python3.7 python3.8 python3.9 python3.10 python3.11 python3.12 python3.13 python3.14 | |
| --input-dir spack-packages/repos/spack_repo/builtin/packages/ | |
| --output-dir canonicalized |