From 70d5a63292bd784a435b4987e76d3802e1288563 Mon Sep 17 00:00:00 2001 From: Benoit Pierre Date: Sun, 14 Apr 2024 17:32:33 +0200 Subject: [PATCH] ci: remove CircleCI unnecessary steps The docker images should already contain all the necessary tools. --- .ci/common.sh | 13 -------- .ci/helper_luarocks.sh | 22 -------------- .ci/install.sh | 69 ------------------------------------------ .circleci/config.yml | 25 +++------------ 4 files changed, 4 insertions(+), 125 deletions(-) delete mode 100755 .ci/helper_luarocks.sh delete mode 100755 .ci/install.sh diff --git a/.ci/common.sh b/.ci/common.sh index 3f3c0199b..16d76295e 100755 --- a/.ci/common.sh +++ b/.ci/common.sh @@ -60,16 +60,3 @@ retry_cmd() { set -e return ${result} } - -# export CI_BUILD_DIR=${TRAVIS_BUILD_DIR} -# use eval to get fully expanded path -eval CI_BUILD_DIR="${CIRCLE_WORKING_DIRECTORY}" -export CI_BUILD_DIR - -test -e "${HOME}/bin" || mkdir "${HOME}/bin" -export PATH=${PWD}/bin:${HOME}/bin:${PATH} -export PATH=${PATH}:${CI_BUILD_DIR}/install/bin -if [ -f "${CI_BUILD_DIR}/install/bin/luarocks" ]; then - # add local rocks to $PATH - eval "$(luarocks path --bin)" -fi diff --git a/.ci/helper_luarocks.sh b/.ci/helper_luarocks.sh deleted file mode 100755 index 5bb8faed0..000000000 --- a/.ci/helper_luarocks.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -# shellcheck source=/dev/null -source "${CI_DIR}/common.sh" - -rm -rf "${HOME}/.luarocks" -mkdir "${HOME}/.luarocks" -cp "${CI_BUILD_DIR}/install/etc/luarocks/config.lua" "${HOME}/.luarocks/config.lua" -echo "wrap_bin_scripts = false" >>"${HOME}/.luarocks/config.lua" -travis_retry luarocks --local install luafilesystem -# for verbose_print module -travis_retry luarocks --local install ansicolors -travis_retry luarocks --local install busted 2.0.0-1 -#- mv -f $HOME/.luarocks/bin/busted_bootstrap $HOME/.luarocks/bin/busted - -travis_retry luarocks --local install luacheck 0.25.0-1 -travis_retry luarocks --local install lanes # for parallel luacheck - -# used only on master branch but added to cache for better speed -travis_retry luarocks --local install ldoc -travis_retry luarocks --local install luacov diff --git a/.ci/install.sh b/.ci/install.sh deleted file mode 100755 index 1d595824f..000000000 --- a/.ci/install.sh +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env bash - -CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -# shellcheck source=/dev/null -source "${CI_DIR}/common.sh" - -# print some useful info -echo "BUILD_DIR: ${CI_BUILD_DIR}" -echo "pwd: $(pwd)" -ls - -# toss submodules if there are any changes -# if [ "$(git status --ignore-submodules=dirty --porcelain)" ]; then -# "--ignore-submodules=dirty", removed temporarily, as it did not notice as -# expected that base was updated and kept using old cached base -if [ "$(git status --ignore-submodules=dirty --porcelain)" ]; then - # what changed? - git status - # purge and reinit submodules - git submodule deinit -f . - git submodule update --init -else - echo -e "${ANSI_GREEN}Using cached submodules." -fi - -# install our own updated luarocks -echo "luarocks installation path: ${CI_BUILD_DIR}" -if [ ! -f "${CI_BUILD_DIR}/install/bin/luarocks" ]; then - git clone https://github.com/torch/luajit-rocks.git - pushd luajit-rocks && { - git checkout 6529891 - cmake . -DWITH_LUAJIT21=ON -DCMAKE_INSTALL_PREFIX="${CI_BUILD_DIR}/install" - make install - } && popd || exit -else - echo -e "${ANSI_GREEN}Using cached luarocks." -fi - -if [ ! -d "${HOME}/.luarocks" ] || [ ! -f "${HOME}/.luarocks/$(md5sum <"${CI_DIR}/helper_luarocks.sh")" ]; then - echo -e "${ANSI_GREEN}Grabbing new .luarocks." - sudo apt-get update - # install openssl devel for luasec - sudo apt-get -y install libssl-dev - - "${CI_DIR}/helper_luarocks.sh" - touch "${HOME}/.luarocks/$(md5sum <"${CI_DIR}/helper_luarocks.sh")" -else - echo -e "${ANSI_GREEN}Using cached .luarocks." -fi - -#install our own updated shellcheck -SHELLCHECK_VERSION="v0.8.0" -SHELLCHECK_URL="https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION?}/shellcheck-${SHELLCHECK_VERSION?}.linux.x86_64.tar.xz" -if ! command -v shellcheck; then - curl -sSL "${SHELLCHECK_URL}" | tar --exclude 'SHA256SUMS' --strip-components=1 -C "${HOME}/bin" -xJf - - chmod +x "${HOME}/bin/shellcheck" - shellcheck --version -else - echo -e "${ANSI_GREEN}Using cached shellcheck." -fi - -# install shfmt -SHFMT_URL="https://github.com/mvdan/sh/releases/download/v3.2.0/shfmt_v3.2.0_linux_amd64" -if [ "$(shfmt --version)" != "v3.2.0" ]; then - curl -sSL "${SHFMT_URL}" -o "${HOME}/bin/shfmt" - chmod +x "${HOME}/bin/shfmt" -else - echo -e "${ANSI_GREEN}Using cached shfmt." -fi diff --git a/.circleci/config.yml b/.circleci/config.yml index 8811ab21b..ce3a16e7b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -22,13 +22,11 @@ jobs: password: $DOCKER_PASSWORD environment: EMULATE_READER: 1 + environment: + BASH_ENV: "~/.bashrc" parallelism: 2 steps: - checkout - - restore_cache: - keys: - # binary dependencies require {{ arch }} because there are different CPUs in use on the servers - - deps-{{ arch }}-{{ checksum ".ci/install.sh" }}-{{ checksum ".ci/helper_luarocks.sh" }} # need to init some stuff first or git will complain when sticking in base cache - run: git submodule init base && git submodule update base && pushd base && git submodule init && git submodule update && popd # we can't use command output directly for cache check so we write it to git-rev-base @@ -36,19 +34,6 @@ jobs: - restore_cache: keys: - build-{{ arch }}-{{ checksum "git-rev-base" }} - - run: echo 'export PATH=${HOME}/bin:${PATH}' >> $BASH_ENV - - # installs and caches testing tools - - run: - name: install - command: .ci/install.sh - - save_cache: - key: deps-{{ arch }}-{{ checksum ".ci/install.sh" }}-{{ checksum ".ci/helper_luarocks.sh" }} - paths: - - "/home/ko/bin" - - "/home/ko/.luarocks" - # compiled luarocks binaries - - "install" # installs everything and caches base - run: @@ -90,13 +75,11 @@ jobs: password: $DOCKER_PASSWORD environment: EMULATE_READER: 1 + environment: + BASH_ENV: "~/.bashrc" parallelism: 1 steps: - checkout - - restore_cache: - keys: - # binary dependencies require {{ arch }} because there are different CPUs in use on the servers - - deps-{{ arch }}-{{ checksum ".ci/install.sh" }}-{{ checksum ".ci/helper_luarocks.sh" }} # need to init some stuff first or git will complain when sticking in base cache - run: git submodule init base && git submodule update base && pushd base && git submodule init && git submodule update && popd # we can't use command output directly for cache check so we write it to git-rev-base