# Clojure CircleCI 2.0 configuration file # # Check https://circleci.com/docs/2.0/language-clojure/ for more details # version: 2.1 jobs: jvm: docker: # specify the version you desire here - image: circleci/clojure:lein-2.9.1 working_directory: ~/repo environment: LEIN_ROOT: "true" BABASHKA_PLATFORM: linux # could be used in jar name resource_class: large steps: - checkout - run: name: "Pull Submodules" command: | git submodule init git submodule update - restore_cache: keys: - v1-dependencies-{{ checksum "project.clj" }}-{{ checksum "deps.edn" }} # fallback to using the latest cache if no exact match is found - v1-dependencies- - run: name: Install Clojure command: | wget -nc https://download.clojure.org/install/linux-install-1.10.1.447.sh chmod +x linux-install-1.10.1.447.sh sudo ./linux-install-1.10.1.447.sh - run: name: Install lsof command: | sudo apt-get install lsof - run: name: Run JVM tests command: | export BABASHKA_FEATURE_JDBC=true export BABASHKA_FEATURE_POSTGRESQL=true script/test script/run_lib_tests # - run: # name: Run as tools.deps dependency # command: | # .circleci/script/tools.deps - run: name: Run as lein command command: | .circleci/script/lein - run: name: Create uberjar command: | mkdir -p /tmp/release script/uberjar VERSION=$(cat resources/BABASHKA_VERSION) cp target/babashka-$VERSION-standalone.jar /tmp/release/babashka-$VERSION-standalone.jar - store_artifacts: path: /tmp/release destination: release - save_cache: paths: - ~/.m2 key: v1-dependencies-{{ checksum "project.clj" }}-{{ checksum "deps.edn" }} linux: docker: - image: circleci/clojure:lein-2.9.1 working_directory: ~/repo environment: LEIN_ROOT: "true" GRAALVM_HOME: /home/circleci/graalvm-ce-java11-20.3.0 BABASHKA_PLATFORM: linux # used in release script BABASHKA_TEST_ENV: native BABASHKA_XMX: "-J-Xmx6500m" resource_class: large steps: - checkout - run: name: "Pull Submodules" command: | git submodule init git submodule update - restore_cache: keys: - linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }} - run: name: Install Clojure command: | wget https://download.clojure.org/install/linux-install-1.10.1.447.sh chmod +x linux-install-1.10.1.447.sh sudo ./linux-install-1.10.1.447.sh - run: name: Install lsof command: | sudo apt-get install lsof - run: name: Install native dev tools command: | sudo apt-get update sudo apt-get -y install gcc g++ zlib1g-dev - run: name: Download GraalVM command: | cd ~ if ! [ -d graalvm-ce-java11-20.3.0 ]; then curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.3.0/graalvm-ce-java11-linux-amd64-20.3.0.tar.gz tar xzf graalvm-ce-java11-linux-amd64-20.3.0.tar.gz fi - run: name: Build binary command: | script/uberjar script/compile no_output_timeout: 30m - run: name: Run tests command: | script/test script/run_lib_tests - run: name: Release command: | .circleci/script/release - save_cache: paths: - ~/.m2 - ~/graalvm-ce-java11-20.3.0 key: linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }} - store_artifacts: path: /tmp/release destination: release - run: name: Publish artifact link to Slack command: | ./bb .circleci/script/publish_artifact.clj linux-static: docker: - image: circleci/clojure:lein-2.9.1 working_directory: ~/repo environment: LEIN_ROOT: "true" GRAALVM_HOME: /home/circleci/graalvm-ce-java11-20.3.0 BABASHKA_PLATFORM: linux-static # used in release script BABASHKA_TEST_ENV: native BABASHKA_STATIC: true BABASHKA_XMX: "-J-Xmx6500m" resource_class: large steps: - checkout - run: name: "Pull Submodules" command: | git submodule init git submodule update - restore_cache: keys: - linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }} - run: name: Install Clojure command: | wget https://download.clojure.org/install/linux-install-1.10.1.447.sh chmod +x linux-install-1.10.1.447.sh sudo ./linux-install-1.10.1.447.sh - run: name: Install lsof command: | sudo apt-get install lsof - run: name: Install native dev tools command: | sudo apt-get update sudo apt-get -y install gcc g++ zlib1g-dev - run: name: Download GraalVM command: | cd ~ if ! [ -d graalvm-ce-java11-20.3.0 ]; then curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.3.0/graalvm-ce-java11-linux-amd64-20.3.0.tar.gz tar xzf graalvm-ce-java11-linux-amd64-20.3.0.tar.gz fi - run: name: Build binary command: | script/uberjar script/compile no_output_timeout: 30m - run: name: Run tests command: | script/test script/run_lib_tests - run: name: Release command: | .circleci/script/release - save_cache: paths: - ~/.m2 - ~/graalvm-ce-java11-20.3.0 key: linux-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }} - store_artifacts: path: /tmp/release destination: release - run: name: Publish artifact link to Slack command: | ./bb .circleci/script/publish_artifact.clj mac: macos: xcode: "12.0.0" environment: MACOSX_DEPLOYMENT_TARGET: 10.13 # 10.12 is EOL GRAALVM_HOME: /Users/distiller/graalvm-ce-java11-20.3.0/Contents/Home BABASHKA_PLATFORM: macos # used in release script BABASHKA_TEST_ENV: native BABASHKA_XMX: "-J-Xmx6500m" resource_class: large steps: - checkout - run: name: "Pull Submodules" command: | git submodule init git submodule update - restore_cache: keys: - mac-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }} - run: name: Install Clojure command: | script/install-clojure /usr/local - run: name: Install Leiningen command: | script/install-leiningen - run: name: Download GraalVM command: | cd ~ ls -la if ! [ -d graalvm-ce-java11-20.3.0 ]; then curl -O -sL https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.3.0/graalvm-ce-java11-darwin-amd64-20.3.0.tar.gz tar xzf graalvm-ce-java11-darwin-amd64-20.3.0.tar.gz fi - run: name: Build binary command: | export PATH=$GRAALVM_HOME/bin:$PATH script/uberjar script/compile no_output_timeout: 30m - run: name: Run tests command: | export PATH=$GRAALVM_HOME/bin:$PATH script/test script/run_lib_tests - run: name: Release command: | .circleci/script/release - save_cache: paths: - ~/.m2 - ~/graalvm-ce-java11-20.3.0 key: mac-{{ checksum "project.clj" }}-{{ checksum ".circleci/config.yml" }} - store_artifacts: path: /tmp/release destination: release - run: name: Publish artifact link to Slack command: | ./bb .circleci/script/publish_artifact.clj deploy: resource_class: large docker: - image: circleci/clojure:lein-2.9.1 working_directory: ~/repo environment: LEIN_ROOT: "true" steps: - checkout - run: name: "Pull Submodules" command: | git submodule init git submodule update - restore_cache: keys: - v1-dependencies-{{ checksum "project.clj" }} # fallback to using the latest cache if no exact match is found - v1-dependencies- - run: .circleci/script/deploy - save_cache: paths: - ~/.m2 key: v1-dependencies-{{ checksum "project.clj" }} docker: resource_class: large docker: - image: circleci/buildpack-deps:stretch steps: - checkout - run: name: "Pull Submodules" command: | git submodule init git submodule update - setup_remote_docker: version: 19.03.12 - run: name: Build Docker image command: .circleci/script/docker workflows: version: 2 ci: jobs: - jvm - linux - linux-static - mac - deploy: filters: branches: only: master requires: - jvm - linux - linux-static - mac - docker: filters: branches: only: master requires: - jvm - linux - linux-static - mac