From 8a3e1774ec51b0a0a3bcc9596fe2776af9adf75e Mon Sep 17 00:00:00 2001 From: Ivaylo Papazov Date: Thu, 30 Jan 2020 15:21:12 +0200 Subject: [PATCH] Add CI setup (#14) --- .circleci/config.yml | 97 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..18d0059 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,97 @@ +version: 2.1 + +executors: + ubuntu_1804: + docker: + - image: circleci/buildpack-deps:bionic + macos_1013: + macos: + xcode: "10.0.0" + +commands: + setup_ubuntu: + description: "Setup Ubuntu environment" + parameters: + OTP_VERSION: + type: string + default: "20.3.8.23" + steps: + - run: + name: Setup environment + command: | + sudo apt-get update \ + && sudo apt-get \ + install \ + build-essential \ + cargo \ + cmake \ + autoconf \ + libncurses5-dev + - run: + name: Install OTP + command: | + curl -fsSL -o otp-src.tar.gz https://github.com/erlang/otp/archive/OTP-<< parameters.OTP_VERSION >>.tar.gz + tar -zxf otp-src.tar.gz --strip-components=1 + ./otp_build autoconf && ./configure && make -j$(nproc) && sudo make install + - run: + name: Install rest + command: | + curl https://sh.rustup.rs -sSf | sh -s -- -yq && source $HOME/.cargo/env + + setup_macos: + description: "Setup macos environment" + parameters: + OTP_VERSION: + type: string + default: "20" + steps: + - run: + name: Setup environment + command: | + brew update + brew install rust cmake erlang@<< parameters.OTP_VERSION >> + brew link --force erlang@<< parameters.OTP_VERSION >> + + run_build: + description: "Build" + steps: + - run: + name: Build + command: | + make + +jobs: + ubuntu_1804_otp20: + executor: ubuntu_1804 + steps: + - checkout + - setup_ubuntu + - run_build + ubuntu_1804_otp21: + executor: ubuntu_1804 + steps: + - checkout + - setup_ubuntu: + OTP_VERSION: "21.0" + - run_build + macos_1013_otp20: + executor: macos_1013 + steps: + - checkout + - setup_macos + - run_build + macos_1013_otp21: + executor: macos_1013 + steps: + - checkout + - setup_macos: + OTP_VERSION: "21" + - run_build + +workflows: + check: + jobs: + - ubuntu_1804_otp20 + - ubuntu_1804_otp21 + - macos_1013_otp20 + - macos_1013_otp21