summaryrefslogtreecommitdiff
path: root/.github/workflows/unit_tests.yaml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/unit_tests.yaml')
-rw-r--r--.github/workflows/unit_tests.yaml33
1 files changed, 25 insertions, 8 deletions
diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml
index 3856f1039f..6b1411c61b 100644
--- a/.github/workflows/unit_tests.yaml
+++ b/.github/workflows/unit_tests.yaml
@@ -1,6 +1,7 @@
name: unit tests
on:
+ workflow_dispatch:
workflow_call:
inputs:
core:
@@ -14,7 +15,7 @@ on:
type: string
concurrency:
- group: unit_tests-${{ github.workflow }}-${{ github.event.pull_request.number || github.run_number }}
+ group: unit_tests-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}
cancel-in-progress: true
jobs:
@@ -25,11 +26,26 @@ jobs:
matrix:
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10']
concretizer: ['clingo']
+ on_develop:
+ - ${{ github.ref == 'refs/heads/develop' }}
include:
- python-version: 2.7
concretizer: original
- - python-version: 3.9
+ on_develop: false
+ - python-version: '3.10'
concretizer: original
+ on_develop: false
+ exclude:
+ - python-version: '3.7'
+ concretizer: 'clingo'
+ on_develop: false
+ - python-version: '3.8'
+ concretizer: 'clingo'
+ on_develop: false
+ - python-version: '3.9'
+ concretizer: 'clingo'
+ on_develop: false
+
steps:
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # @v2
with:
@@ -46,7 +62,7 @@ jobs:
patchelf cmake bison libbison-dev kcov
- name: Install Python packages
run: |
- pip install --upgrade pip six setuptools pytest codecov "coverage[toml]<=6.2"
+ pip install --upgrade pip six setuptools pytest codecov "coverage[toml]<=6.2" pytest-xdist
# ensure style checks are not skipped in unit tests for python >= 3.6
# note that true/false (i.e., 1/0) are opposite in conditions in python and bash
if python -c 'import sys; sys.exit(not sys.version_info >= (3, 6))'; then
@@ -108,7 +124,7 @@ jobs:
sudo apt-get install -y coreutils kcov csh zsh tcsh fish dash bash
- name: Install Python packages
run: |
- pip install --upgrade pip six setuptools pytest codecov coverage[toml]==6.2
+ pip install --upgrade pip six setuptools pytest codecov coverage[toml]==6.2 pytest-xdist
- name: Setup git configuration
run: |
# Need this for the git tests to succeed.
@@ -174,7 +190,7 @@ jobs:
patchelf kcov
- name: Install Python packages
run: |
- pip install --upgrade pip six setuptools pytest codecov coverage[toml]==6.2 clingo
+ pip install --upgrade pip six setuptools pytest codecov coverage[toml]==6.2 clingo pytest-xdist
- name: Setup git configuration
run: |
# Need this for the git tests to succeed.
@@ -216,7 +232,7 @@ jobs:
- name: Install Python packages
run: |
pip install --upgrade pip six setuptools
- pip install --upgrade pytest codecov coverage[toml]==6.2
+ pip install --upgrade pytest codecov coverage[toml]==6.2 pytest-xdist
- name: Setup Homebrew packages
run: |
brew install dash fish gcc gnupg2 kcov
@@ -229,9 +245,10 @@ jobs:
. share/spack/setup-env.sh
$(which spack) bootstrap untrust spack-install
$(which spack) solve zlib
+ common_args=(--dist loadfile --tx '4*popen//python=./bin/spack-tmpconfig python -u ./bin/spack python' -x)
if [ "${{ inputs.with_coverage }}" == "true" ]
then
- coverage run $(which spack) unit-test -x
+ coverage run $(which spack) unit-test "${common_args[@]}"
coverage combine
coverage xml
# Delete the symlink going from ./lib/spack/docs/_spack_root back to
@@ -239,7 +256,7 @@ jobs:
rm lib/spack/docs/_spack_root
else
echo "ONLY PACKAGE RECIPES CHANGED [skipping coverage]"
- $(which spack) unit-test -x -m "not maybeslow" -k "test_all_virtual_packages_have_default_providers"
+ $(which spack) unit-test "${common_args[@]}" -m "not maybeslow" -k "test_all_virtual_packages_have_default_providers"
fi
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # @v2.1.0
if: ${{ inputs.with_coverage == 'true' }}