diff --git a/.circleci/config.yml b/.circleci/config.yml index fdb58f692..e3f517058 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,13 +7,13 @@ version: 2 - checkout - run: name: Configure - command: autoreconf -i && ./configure --enable-silent-rules ${CONFIGURE_ARGS} + command: scripts/git_no_checkin_in_last_day.sh || (autoreconf -i && ./configure --enable-silent-rules ${CONFIGURE_ARGS}) - run: name: Build - command: source ~/.bashrc && make -j && make check + command: scripts/git_no_checkin_in_last_day.sh || (source ~/.bashrc && make -j && make check) - run: name: Run tests - command: mkdir -p test-results/pytest && python3 -m pytest --verbose --junitxml=test-results/pytest/results.xml --numprocesses=auto + command: mkdir -p test-results/pytest && scripts/git_no_checkin_in_last_day.sh || (python3 -m pytest --verbose --junitxml=test-results/pytest/results.xml --numprocesses=auto) - store_test_results: # Note that this command will fail when running CircleCI locally, that is expected behaviour path: test-results - store_artifacts: @@ -30,6 +30,7 @@ version: 2 - run: # Skipping sig-sphincs because it exhausts memory on CircleCI name: Run the tests in a container command: | + scripts/git_no_checkin_in_last_day.sh && docker run -e SKIP_TESTS=style --rm -v `pwd`:`pwd` -w `pwd` dstebila/liboqs:debian-buster-${ARCH}-0.1.0 /bin/bash -c " uname -a && file /bin/ls && @@ -99,6 +100,39 @@ jobs: environment: IMAGE: openqsafe/ci-centos-8 SKIP_TESTS: style + osx: + macos: + xcode: "11.3.0" + environment: + CONFIGURE_ARGS: --without-openssl + SKIP_TESTS: style + steps: + - checkout + - run: + name: Install dependencies + command: | + scripts/git_no_checkin_in_last_day.sh || ( + brew update && + brew unlink python@2 && + brew install autoconf automake libtool wget doxygen graphviz clang-format && + pip3 install pytest pytest-xdist + ) + - run: + name: Configure + command: scripts/git_no_checkin_in_last_day.sh || (autoreconf -i && ./configure --enable-silent-rules ${CONFIGURE_ARGS}) + - run: + name: Build + command: scripts/git_no_checkin_in_last_day.sh || (make -j && make check) + - run: + name: System information + command: scripts/git_no_checkin_in_last_day.sh || (sysctl -a | grep machdep.cpu && cat src/kem/sike/Makefile && ls -l tests) + - run: + name: Run tests + command: mkdir -p test-results/pytest && scripts/git_no_checkin_in_last_day.sh || (python3 -m pytest --verbose --junitxml=test-results/pytest/results.xml --numprocesses=auto) + - store_test_results: # Note that this command will fail when running CircleCI locally, that is expected behaviour + path: test-results + - store_artifacts: + path: test-results workflows: version: 2 @@ -107,6 +141,7 @@ workflows: - centos-7 - centos-8 - debian-buster-amd64 + - osx - ubuntu-bionic-x86_64-gcc7 - ubuntu-bionic-x86_64-gcc7-noopenssl - ubuntu-bionic-x86_64-gcc7-noshared @@ -121,6 +156,7 @@ workflows: jobs: - centos-7 - centos-8 + - osx - debian-buster-amd64 - debian-buster-aarch64 - debian-buster-armhf diff --git a/.travis.yml b/.travis.yml index 53894b682..f982b305b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,41 +15,3 @@ matrix: script: - scripts/arm-cross-compile.sh - scripts/arm-run-tests-qemu.sh - - os: osx - compiler: clang - env: - - WITH_OPENSSL=1 - - SKIP_TESTS=style - - HOMEBREW_NO_AUTO_UPDATE=1 - before_install: - - brew install doxygen graphviz openssl@1.1 - - pip3 install pytest pytest-xdist - script: - - autoreconf -i - - ./configure --enable-silent-rules - - make - - make test - - ./configure --enable-silent-rules --disable-shared - - make clean - - make - - make check - - python3 -m pytest --verbose --numprocesses=auto - - os: osx - compiler: clang - env: - - WITH_OPENSSL=0 - - SKIP_TESTS=style - - HOMEBREW_NO_AUTO_UPDATE=1 - before_install: - - brew install doxygen graphviz - - pip3 install pytest pytest-xdist - script: - - autoreconf -i - - ./configure --enable-silent-rules --without-openssl - - make - - make test - - ./configure --enable-silent-rules --disable-shared - - make clean - - make - - make check - - python3 -m pytest --verbose --numprocesses=auto diff --git a/scripts/git_no_checkin_in_last_day.sh b/scripts/git_no_checkin_in_last_day.sh new file mode 100755 index 000000000..8f81a8688 --- /dev/null +++ b/scripts/git_no_checkin_in_last_day.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Detects whether there has been a Git commit in the last day on this +# branch. Returns 1 if there has been a commit, 0 if there has not. + +r=`git log --name-only --since="1 day ago" -n 2` +if [ "x$r" == "x" ]; then + echo "No commit in the last day. No build/test required. Exiting." + exit 0 +else + exit 1 +fi