diff --git a/.github/workflows/tests-minimal.yml b/.github/workflows/tests-minimal.yml new file mode 100644 index 00000000..a4ae3a5f --- /dev/null +++ b/.github/workflows/tests-minimal.yml @@ -0,0 +1,30 @@ +name: Tests minimal + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + tests: + name: Minimal test suite + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + submodules: recursive + - name: Set system to non-interactive mode + run: export DEBIAN_FRONTEND=noninteractive + - name: install dependencies + run: | + sudo apt-get install -y --force-yes -qq build-essential + - name: build and install + run: | + mkdir -p build + cd build + cmake -DPORTS_OF_CALL_BUILD_TESTING=ON .. + make -j + make test diff --git a/spack-repo/packages/ports-of-call/package.py b/spack-repo/packages/ports-of-call/package.py index c2bba612..d4c89053 100644 --- a/spack-repo/packages/ports-of-call/package.py +++ b/spack-repo/packages/ports-of-call/package.py @@ -41,11 +41,15 @@ class PortsOfCall(CMakePackage): default="None", when="@:1.2.0", ) + variant("test", default=False, description="Build tests") depends_on("cmake@3.12:") + depends_on("catch2@3.0.1:", when"+test") def cmake_args(self): - args = [] + args = [ + self.define_from_variant("PORTS_OF_CALL_BUILD_TESTING", "test"), + ] if self.spec.satisfies("@:1.2.0"): args.append(self.define_from_variant("PORTABILITY_STRATEGY", "portability_strategy")) return args