diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..8d3667af6 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,125 @@ +version: 2 + +orbs: + python: circleci/python@2.0.3 + +jobs: + + test-macos: + macos: + xcode: "12.5.1" + # resource_class: macos.x86.medium.gen2 + working_directory: ~/ocrd-core + environment: + PIP: pip3 + PYTHON: python3 + PIP_INSTALL: pip3 install --user + steps: + - checkout + - run: HOMEBREW_NO_AUTO_UPDATE=1 brew install imagemagick geos bash opencv + - run: $PIP_INSTALL -U pip setuptools + - run: make install + - run: export PATH="/Users/distiller/Library/Python/3.9/bin:$PATH"; make deps-test test benchmark + + test-python37: + docker: + - image: cimg/python:3.7 + working_directory: ~/ocrd-core + steps: + - checkout + - run: sudo apt-get -y update + - run: sudo make deps-ubuntu + - run: make install deps-test + - run: make test benchmark + # smoke test to ensure that --editable install works + - run: make install-dev; ocrd --version + + test-python38: + docker: + - image: cimg/python:3.8 + working_directory: ~/ocrd-core + steps: + - checkout + - run: sudo apt-get -y update + - run: sudo make deps-ubuntu + - run: make install deps-test + - run: make test benchmark + # smoke test to ensure that --editable install works + - run: make install-dev; ocrd --version + + test-python39: + docker: + - image: cimg/python:3.9 + working_directory: ~/ocrd-core + steps: + - checkout + - run: sudo apt-get -y update + - run: sudo make deps-ubuntu + - run: make install deps-test + - run: make test benchmark + # smoke test to ensure that --editable install works + - run: make install-dev; ocrd --version + + test-python310: + docker: + - image: cimg/python:3.10 + working_directory: ~/ocrd-core + steps: + - checkout + - run: sudo apt-get -y update + - run: sudo make deps-ubuntu + - run: make install deps-test + - run: make test benchmark + # smoke test to ensure that --editable install works + - run: make install-dev; ocrd --version + + test-python311: + docker: + - image: cimg/python:3.11 + working_directory: ~/ocrd-core + steps: + - checkout + - run: sudo apt-get -y update + - run: sudo make deps-ubuntu + - run: make install deps-test + - run: make test benchmark + # smoke test to ensure that --editable install works + - run: make install-dev; ocrd --version + + deploy: + docker: + - image: circleci/buildpack-deps:stretch + steps: + - checkout + - setup_remote_docker: # https://circleci.com/docs/2.0/building-docker-images/ + docker_layer_caching: true + - run: make docker + - run: make docker-cuda + - run: + name: Login to Docker Hub + command: echo "$DOCKERHUB_PASS" | docker login --username "$DOCKERHUB_USERNAME" --password-stdin + - run: docker push ocrd/core:latest + - run: docker push ocrd/core-cuda:latest + - run: docker tag ocrd/core ocrd/core:$(git describe --tags --abbrev=0) + - run: docker tag ocrd/core-cuda ocrd/core-cuda:$(git describe --tags --abbrev=0) + - run: docker push ocrd/core:$(git describe --tags --abbrev=0) + - run: docker push ocrd/core-cuda:$(git describe --tags --abbrev=0) + +workflows: + version: 2 + build-master: + jobs: + - deploy: + filters: + branches: + only: master + tags: + only: /^v\d\.\d\d\.\d$/ + test-pull-request: + jobs: + - test-python37 + - test-python38 + - test-python39 + - test-python310 + - test-python311 + # - test-macos