From 03e10b3cde7767910c1f28f12c8b6078b61eaf96 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Sat, 20 Mar 2021 15:16:52 +0100 Subject: QA: reduce number of unit tests for jobs not in the matrix (#22426) * QA: reduce number of unit tests for jobs not in the matrix * Fixup for CentOS6 dependencies * Put correct conditions back in place * Add dependency on changes --- .github/workflows/unit_tests.yaml | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 3161bc15e1..385e3a1e46 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -233,13 +233,27 @@ jobs: flags: shelltests,linux # Test for Python2.6 run on Centos 6 centos6: - needs: [ validate, style, documentation ] + needs: [ validate, style, documentation, changes ] runs-on: ubuntu-latest container: spack/github-actions:centos6 steps: - - name: Run unit tests + - name: Run unit tests (full test-suite) + # The CentOS 6 container doesn't run with coverage, but + # under the same conditions it runs the full test suite + if: ${{ needs.changes.outputs.with_coverage == 'true' }} + env: + HOME: /home/spack-test + run: | + whoami && echo $HOME && cd $HOME + git clone https://github.com/spack/spack.git && cd spack + git fetch origin ${{ github.ref }}:test-branch + git checkout test-branch + share/spack/qa/run-unit-tests + - name: Run unit tests (only package tests) + if: ${{ needs.changes.outputs.with_coverage == 'false' }} env: HOME: /home/spack-test + ONLY_PACKAGES: true run: | whoami && echo $HOME && cd $HOME git clone https://github.com/spack/spack.git && cd spack @@ -247,10 +261,12 @@ jobs: git checkout test-branch share/spack/qa/run-unit-tests - # Test RHEL8 UBI with platform Python + # Test RHEL8 UBI with platform Python. This job is run + # only on PRs modifying core Spack rhel8-platform-python: - needs: [ validate, style, documentation ] + needs: [ validate, style, documentation, changes ] runs-on: ubuntu-latest + if: ${{ needs.changes.outputs.with_coverage == 'true' }} container: registry.access.redhat.com/ubi8/ubi steps: - name: Install dependencies @@ -289,9 +305,14 @@ jobs: . share/spack/setup-env.sh spack compiler find spack solve mpileaks%gcc - coverage run $(which spack) unit-test -v - coverage combine - coverage xml + if [ "${{ needs.changes.outputs.with_coverage }}" == "true" ] + then + coverage run $(which spack) unit-test -v -x + coverage combine + coverage xml + else + $(which spack) unit-test -m "not maybeslow" -k "package_sanity" + fi - uses: codecov/codecov-action@v1 if: ${{ needs.changes.outputs.with_coverage == 'true' }} with: -- cgit v1.2.3-60-g2f50