diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..a9d2367 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,48 @@ +version: 2.1 +jobs: + build: + docker: + - image: 'opensuse:leap' + steps: + - run: 'zypper install -y --type pattern devel_basis devel_C_C++' + - run: 'zypper install -y git python3-devel python-devel gcc-c++ unzip' + - run: + name: Set path variable + command: | + SHORT_SHA1=$(echo "${CIRCLE_SHA1}" | cut -c 1-10) + echo 'export TOOLCHAIN_PATH="/opt/grisp/grisp-software/grisp-base/'$SHORT_SHA1'"' >> $BASH_ENV + - run: mkdir -p ${TOOLCHAIN_PATH} + - checkout + - run: shopt -s dotglob && mv ./* "${TOOLCHAIN_PATH}" + - run: 'git -C "${TOOLCHAIN_PATH}" submodule update --init rtems-source-builder' + - run: + name: Disable parallelism during gcc build due to RAM limit at CircleCI + command: 'sed -i "s/%define with_threads 1/%define with_threads 0/" ${TOOLCHAIN_PATH}/rtems-source-builder/rtems/config/tools/rtems-gcc-7.3.0-newlib-3.0.0.cfg' + - run: + command: cd $TOOLCHAIN_PATH; ./build/build.sh + no_output_timeout: 90m + - persist_to_workspace: + root: /opt + paths: + - grisp/*/*/*/rtems-install + deploy: + docker: + - image: 'opensuse:leap' + steps: + - run: 'zypper install -y aws-cli tar gzip' + - attach_workspace: + at: /opt + - run: + command: "GRISP_TOOLCHAIN_REVISION=$(cat /opt/grisp/*/*/*/rtems-install/rtems/5/GRISP_TOOLCHAIN_REVISION) && + tar -czf /tmp/grisp_toolchain_arm-rtems5_Linux_$GRISP_TOOLCHAIN_REVISION.tar.gz ." + working_directory: /opt + - deploy: + command: aws s3 cp /tmp/grisp_toolchain_*.tar.gz s3://grisp/platforms/grisp_base/toolchain/ --acl public-read +workflows: + version: 2 + build-deploy: + jobs: + - build + - deploy: + requires: + - build