blob: 9a61b7deda51798b963d8f5a0b241e93480be551 [file]
version: 2.1
# CircleCI doesn't handle large file sets properly for local builds
# https://github.com/CircleCI-Public/circleci-cli/issues/281#issuecomment-472808051
localCheckout: &localCheckout
run: |-
PROJECT_PATH=$(cd ${CIRCLE_WORKING_DIRECTORY}; pwd)
mkdir -p ${PROJECT_PATH}
cd /tmp/_circleci_local_build_repo
git ls-files -z | xargs -0 -s 2090860 tar -c | tar -x -C ${PROJECT_PATH}
cp -a /tmp/_circleci_local_build_repo/.git ${PROJECT_PATH}
jobs:
ubuntu_bionic:
description: A template for building and testing liboqs-python on Ubuntu Linux
docker:
- image: openquantumsafe/ci-ubuntu-bionic-x86_64:latest
auth:
username: $DOCKER_LOGIN
password: $DOCKER_PASSWORD
steps:
- checkout # change this from "checkout" to "*localCheckout" when running CircleCI locally
- run:
name: Authenticate to Docker
command: |
echo $DOCKER_PASSWORD | docker login --username $DOCKER_LOGIN --password-stdin
- run:
name: Build and install liboqs
command: |
git clone --branch main --single-branch --depth 1 https://github.com/open-quantum-safe/liboqs
cd liboqs && mkdir build && cd build
cmake .. -GNinja -DBUILD_SHARED_LIBS=ON -DOQS_BUILD_ONLY_LIB=ON
ninja install
- run:
name: Run examples
command: |
export LD_LIBRARY_PATH=/usr/local/lib
apt-get update
apt-get -y install python3-venv
python3 -m venv venv && source venv/bin/activate && python setup.py install
python examples/kem.py
python examples/sig.py
python examples/rand.py
- run:
name: Run unit tests
command: |
export LD_LIBRARY_PATH=/usr/local/lib
source venv/bin/activate && pip install nose rednose
python -m nose --rednose --verbose
macOS:
description: A template for building and testing liboqs-python on macOS
macos:
xcode: "13.2.1"
steps:
- checkout # change this from "checkout" to "*localCheckout" when running CircleCI locally
- run:
name: Install dependencies
command: |
brew install ninja cmake
- run:
name: Build and install liboqs
command: |
git clone --branch main --single-branch --depth 1 https://github.com/open-quantum-safe/liboqs
cd liboqs && mkdir build && cd build
cmake .. -GNinja -DBUILD_SHARED_LIBS=ON -DOQS_BUILD_ONLY_LIB=ON
ninja install
- run:
name: Run examples
command: |
export LD_LIBRARY_PATH=/usr/local/lib
python3 -m venv venv && source venv/bin/activate && python setup.py install
python examples/kem.py
python examples/sig.py
python examples/rand.py
- run:
name: Run unit tests
command: |
export LD_LIBRARY_PATH=/usr/local/lib
source venv/bin/activate && pip install nose rednose
python -m nose --rednose --verbose
dockerbuild:
description: Building and pushing oqs-enabled python image
docker:
- image: openquantumsafe/ci-ubuntu-bionic-x86_64:latest
auth:
username: $DOCKER_LOGIN
password: $DOCKER_PASSWORD
steps:
- checkout # change this from "checkout" to "*localCheckout" when running CircleCI locally
- setup_remote_docker
- run:
name: Authenticate to Docker
command: |
echo $DOCKER_PASSWORD | docker login --username $DOCKER_LOGIN --password-stdin
- run:
name: Build docker image
command: |
docker build --build-arg MAKE_DEFINES="-j 18" -t oqs-python .
working_directory: docker
- run:
name: Test docker image
command: |
docker run -e SHORT_TEST="Yes" oqs-python
- when:
condition:
equal: [ main, << pipeline.git.branch >> ]
steps:
- run:
name: Push docker image
command: |
export SHORT_GITID=`git rev-parse --short HEAD`
docker tag oqs-python $TARGETNAME/python:latest && \
docker push $TARGETNAME/python:latest && \
docker tag oqs-python $TARGETNAME/python:$SHORT_GITID && \
docker push $TARGETNAME/python:$SHORT_GITID
workflows:
build:
jobs:
- dockerbuild:
context: openquantumsafe
- ubuntu_bionic:
name: ubuntu-bionic
context: openquantumsafe
- macOS:
name: macOS-base
context: openquantumsafe