diff options
Diffstat (limited to '.github/workflows/unit_tests.yaml')
-rw-r--r-- | .github/workflows/unit_tests.yaml | 122 |
1 files changed, 76 insertions, 46 deletions
diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index b05a935c6a..72184b7fbf 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -16,45 +16,34 @@ jobs: matrix: os: [ubuntu-latest] python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] - concretizer: ['clingo'] on_develop: - ${{ github.ref == 'refs/heads/develop' }} include: - - python-version: '3.11' - os: ubuntu-latest - concretizer: original - on_develop: ${{ github.ref == 'refs/heads/develop' }} - python-version: '3.6' os: ubuntu-20.04 - concretizer: clingo on_develop: ${{ github.ref == 'refs/heads/develop' }} exclude: - python-version: '3.7' os: ubuntu-latest - concretizer: 'clingo' on_develop: false - python-version: '3.8' os: ubuntu-latest - concretizer: 'clingo' on_develop: false - python-version: '3.9' os: ubuntu-latest - concretizer: 'clingo' on_develop: false - python-version: '3.10' os: ubuntu-latest - concretizer: 'clingo' on_develop: false - python-version: '3.11' os: ubuntu-latest - concretizer: 'clingo' on_develop: false steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @v2 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: fetch-depth: 0 - - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # @v2 + - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b with: python-version: ${{ matrix.python-version }} - name: Install System packages @@ -72,7 +61,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: @@ -85,23 +74,25 @@ jobs: - name: Run unit tests env: SPACK_PYTHON: python - SPACK_TEST_SOLVER: ${{ matrix.concretizer }} SPACK_TEST_PARALLEL: 2 COVERAGE: true + COVERAGE_FILE: coverage/.coverage-${{ matrix.os }}-python${{ matrix.python-version }} UNIT_TEST_COVERAGE: ${{ matrix.python-version == '3.11' }} run: | share/spack/qa/run-unit-tests - - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 with: - flags: unittests,linux,${{ matrix.concretizer }} + 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@b4ffde65f46336ab88eb53be808477a3936bae11 # @v2 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: fetch-depth: 0 - - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # @v2 + - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b with: python-version: '3.11' - name: Install System packages @@ -116,15 +107,17 @@ 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 run: | share/spack/qa/run-shell-tests - - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 with: - flags: shelltests,linux + 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 @@ -137,13 +130,13 @@ jobs: dnf install -y \ bzip2 curl file gcc-c++ gcc gcc-gfortran git gnupg2 gzip \ make patch tcl unzip which xz - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @v2 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - name: Setup repo and non-root user run: | 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 @@ -156,45 +149,49 @@ jobs: clingo-cffi: runs-on: ubuntu-latest steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @v2 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: fetch-depth: 0 - - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # @v2 + - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b with: - python-version: '3.11' + python-version: '3.13' - name: Install System packages run: | sudo apt-get -y update - sudo apt-get -y install coreutils cvs gfortran graphviz gnupg2 mercurial ninja-build kcov + sudo apt-get -y install coreutils gfortran graphviz gnupg2 - name: Install Python packages run: | - pip install --upgrade pip setuptools pytest coverage[toml] pytest-cov clingo pytest-xdist + pip install --upgrade pip setuptools pytest coverage[toml] pytest-cov clingo 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/setup_git.sh - name: Run unit tests (full suite with coverage) env: COVERAGE: true - SPACK_TEST_SOLVER: clingo + COVERAGE_FILE: coverage/.coverage-clingo-cffi run: | - share/spack/qa/run-unit-tests - - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # @v2.1.0 + . share/spack/setup-env.sh + spack bootstrap disable spack-install + spack bootstrap disable github-actions-v0.5 + spack bootstrap disable github-actions-v0.6 + spack bootstrap status + spack solve zlib + spack unit-test --verbose --cov --cov-config=pyproject.toml --cov-report=xml:coverage.xml lib/spack/spack/test/concretization/core.py + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 with: - flags: unittests,linux,clingo + name: coverage-clingo-cffi + path: coverage + include-hidden-files: true # Run unit tests on MacOS macos: - runs-on: macos-latest + runs-on: ${{ matrix.os }} strategy: matrix: + os: [macos-13, macos-14] python-version: ["3.11"] steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # @v2 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: fetch-depth: 0 - - uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # @v2 + - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b with: python-version: ${{ matrix.python-version }} - name: Install Python packages @@ -203,19 +200,52 @@ jobs: pip install --upgrade pytest coverage[toml] pytest-xdist pytest-cov - name: Setup Homebrew packages run: | - brew install dash fish gcc gnupg2 kcov + brew install dash fish gcc gnupg kcov - name: Run unit tests env: - SPACK_TEST_SOLVER: clingo SPACK_TEST_PARALLEL: 4 + COVERAGE_FILE: coverage/.coverage-${{ matrix.os }}-python${{ matrix.python-version }} 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 common_args=(--dist loadfile --tx '4*popen//python=./bin/spack-tmpconfig python -u ./bin/spack python' -x) $(which spack) unit-test --verbose --cov --cov-config=pyproject.toml --cov-report=xml:coverage.xml "${common_args[@]}" - - uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 + with: + name: coverage-${{ matrix.os }}-python${{ matrix.python-version }} + path: coverage + include-hidden-files: true + # Run unit tests on Windows + windows: + 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 + - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b + with: + python-version: 3.9 + - name: Install Python packages + run: | + python -m pip install --upgrade pip pywin32 setuptools pytest-cov clingo + - name: Create local develop + run: | + ./.github/workflows/bin/setup_git.ps1 + - name: Unit Test + env: + COVERAGE_FILE: coverage/.coverage-windows + run: | + spack unit-test -x --verbose --cov --cov-config=pyproject.toml + ./share/spack/qa/validate_last_exit.ps1 + - uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 with: - flags: unittests,macos + name: coverage-windows + path: coverage + include-hidden-files: true |