Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Move linter task to cirrus (review comments addressed) #5

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
250 changes: 136 additions & 114 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
### Global defaults

timeout_in: 120m # https://cirrus-ci.org/faq/#instance-timed-out
container:
# https://cirrus-ci.org/faq/#are-there-any-limits
# Each project has 16 CPU in total, assign 2 to each container, so that 8 tasks run in parallel
cpu: 2
memory: 8G # Set to 8GB to avoid OOM. https://cirrus-ci.org/guide/linux/#linux-containers
kvm: true # Use kvm to avoid spurious CI failures in the default virtualization cluster, see https://github.com/bitcoin/bitcoin/issues/20093
env:
PACKAGE_MANAGER_INSTALL: "apt-get update && apt-get install -y"
MAKEJOBS: "-j4"
Expand All @@ -15,11 +8,28 @@ env:
CCACHE_SIZE: "200M"
CCACHE_DIR: "/tmp/ccache_dir"

### Global task template

### Base template
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
base_template: &BASE_TEMPLATE
skip: $CIRRUS_REPO_FULL_NAME == "bitcoin-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
merge_base_script:
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
- bash -c "$PACKAGE_MANAGER_INSTALL git"
- git fetch $CIRRUS_REPO_CLONE_URL $CIRRUS_BASE_BRANCH
- git config --global user.email "ci@ci.ci"
- git config --global user.name "ci"
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts

### Global task template
global_task_template: &GLOBAL_TASK_TEMPLATE
skip: $CIRRUS_REPO_FULL_NAME == "bitcoin-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
timeout_in: 120m # https://cirrus-ci.org/faq/#instance-timed-out
container:
# https://cirrus-ci.org/faq/#are-there-any-limits
# Each project has 16 CPU in total, assign 2 to each container, so that 8 tasks run in parallel
cpu: 2
memory: 8G # Set to 8GB to avoid OOM. https://cirrus-ci.org/guide/linux/#linux-containers
kvm: true # Use kvm to avoid spurious CI failures in the default virtualization cluster, see https://github.com/bitcoin/bitcoin/issues/20093
<< : *BASE_TEMPLATE
ccache_cache:
folder: "/tmp/ccache_dir"
depends_built_cache:
Expand All @@ -28,13 +38,6 @@ global_task_template: &GLOBAL_TASK_TEMPLATE
folder: "/tmp/cirrus-ci-build/depends/sdk-sources"
depends_releases_cache:
folder: "/tmp/cirrus-ci-build/releases"
merge_base_script:
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
- bash -c "$PACKAGE_MANAGER_INSTALL git"
- git fetch $CIRRUS_REPO_CLONE_URL $CIRRUS_BASE_BRANCH
- git config --global user.email "ci@ci.ci"
- git config --global user.name "ci"
- git merge FETCH_HEAD # Merge base to detect silent merge conflicts
ci_script:
- ./ci/test_run_all.sh

Expand All @@ -55,107 +58,126 @@ global_task_template: &GLOBAL_TASK_TEMPLATE
# - choco install python --version=3.7.7 -y

task:
name: 'ARM [unit tests, no functional tests] [buster]'
<< : *GLOBAL_TASK_TEMPLATE
container:
image: debian:buster
env:
FILE_ENV: "./ci/test/00_setup_env_arm.sh"

task:
name: 'Win64 [unit tests, no gui tests, no boost::process, no functional tests] [bionic]'
<< : *GLOBAL_TASK_TEMPLATE
name: 'lint'
<< : *BASE_TEMPLATE
container:
image: ubuntu:bionic
env:
FILE_ENV: "./ci/test/00_setup_env_win64.sh"
image: ubuntu:bionic # For python 3.6, oldest supported version according to doc/dependencies.md
cpu: 1 # Cut credits bill in half
# For faster CI feedback, immediately schedule the linters. https://cirrus-ci.org/pricing/#compute-credits
use_compute_credits: $CIRRUS_REPO_FULL_NAME == 'bitcoin/bitcoin'
setup_script:
- set -o errexit; source ./ci/test/00_setup_env.sh
before_install_script:
- set -o errexit; source ./ci/test/03_before_install.sh
install_script:
- set -o errexit; source ./ci/lint/04_install.sh
before_script:
- set -o errexit; source ./ci/lint/05_before_script.sh
lint_script:
- set -o errexit; source ./ci/lint/06_script.sh

task:
name: '32-bit + dash [gui] [CentOS 8]'
<< : *GLOBAL_TASK_TEMPLATE
container:
image: centos:8
env:
PACKAGE_MANAGER_INSTALL: "yum install -y"
FILE_ENV: "./ci/test/00_setup_env_i686_centos.sh"

task:
name: '[previous releases, uses qt5 dev package and some depends packages] [unsigned char] [bionic]'
<< : *GLOBAL_TASK_TEMPLATE
container:
image: ubuntu:bionic
env:
FILE_ENV: "./ci/test/00_setup_env_native_qt5.sh"

task:
name: '[depends, sanitizers: thread (TSan), no gui] [focal]'
<< : *GLOBAL_TASK_TEMPLATE
container:
image: ubuntu:focal
cpu: 4 # Double CPU and increase Memory to avoid timeout
memory: 24G
env:
MAKEJOBS: "-j8"
FILE_ENV: "./ci/test/00_setup_env_native_tsan.sh"

task:
name: '[depends, sanitizers: memory (MSan)] [focal]'
<< : *GLOBAL_TASK_TEMPLATE
container:
image: ubuntu:focal
env:
FILE_ENV: "./ci/test/00_setup_env_native_msan.sh"

task:
name: '[no depends, sanitizers: address/leak (ASan + LSan) + undefined (UBSan) + integer] [focal]'
<< : *GLOBAL_TASK_TEMPLATE
container:
image: ubuntu:focal
env:
FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"

task:
name: '[no depends, sanitizers: fuzzer,address,undefined] [focal]'
<< : *GLOBAL_TASK_TEMPLATE
container:
image: ubuntu:focal
env:
FILE_ENV: "./ci/test/00_setup_env_native_fuzz.sh"

task:
name: '[multiprocess] [focal]'
<< : *GLOBAL_TASK_TEMPLATE
container:
image: ubuntu:focal
env:
FILE_ENV: "./ci/test/00_setup_env_native_multiprocess.sh"

task:
name: '[no wallet] [bionic]'
<< : *GLOBAL_TASK_TEMPLATE
container:
image: ubuntu:bionic
env:
FILE_ENV: "./ci/test/00_setup_env_native_nowallet.sh"

task:
name: 'macOS 10.14 [gui, no tests] [bionic]'
name: 'ARM [unit tests, no functional tests] [buster]'
<< : *GLOBAL_TASK_TEMPLATE
container:
image: ubuntu:bionic
image: debian:buster
env:
FILE_ENV: "./ci/test/00_setup_env_mac.sh"
FILE_ENV: "./ci/test/00_setup_env_arm.sh"

task:
name: 'macOS 10.15 native [gui] [no depends]'
macos_brew_addon_script:
- brew install boost libevent berkeley-db4 qt miniupnpc ccache zeromq qrencode sqlite libtool automake pkg-config gnu-getopt
<< : *GLOBAL_TASK_TEMPLATE
osx_instance:
# Use latest image, but hardcode version to avoid silent upgrades (and breaks)
image: catalina-xcode-12.1 # https://cirrus-ci.org/guide/macOS
env:
DANGER_RUN_CI_ON_HOST: "true"
CI_USE_APT_INSTALL: "no"
PACKAGE_MANAGER_INSTALL: "echo" # Nothing to do
FILE_ENV: "./ci/test/00_setup_env_mac_host.sh"
# task:
# name: 'Win64 [unit tests, no gui tests, no boost::process, no functional tests] [bionic]'
# << : *GLOBAL_TASK_TEMPLATE
# container:
# image: ubuntu:bionic
# env:
# FILE_ENV: "./ci/test/00_setup_env_win64.sh"

# task:
# name: '32-bit + dash [gui] [CentOS 8]'
# << : *GLOBAL_TASK_TEMPLATE
# container:
# image: centos:8
# env:
# PACKAGE_MANAGER_INSTALL: "yum install -y"
# FILE_ENV: "./ci/test/00_setup_env_i686_centos.sh"

# task:
# name: '[previous releases, uses qt5 dev package and some depends packages] [unsigned char] [bionic]'
# << : *GLOBAL_TASK_TEMPLATE
# container:
# image: ubuntu:bionic
# env:
# FILE_ENV: "./ci/test/00_setup_env_native_qt5.sh"

# task:
# name: '[depends, sanitizers: thread (TSan), no gui] [focal]'
# << : *GLOBAL_TASK_TEMPLATE
# container:
# image: ubuntu:focal
# cpu: 4 # Double CPU and increase Memory to avoid timeout
# memory: 24G
# env:
# MAKEJOBS: "-j8"
# FILE_ENV: "./ci/test/00_setup_env_native_tsan.sh"

# task:
# name: '[depends, sanitizers: memory (MSan)] [focal]'
# << : *GLOBAL_TASK_TEMPLATE
# container:
# image: ubuntu:focal
# env:
# FILE_ENV: "./ci/test/00_setup_env_native_msan.sh"

# task:
# name: '[no depends, sanitizers: address/leak (ASan + LSan) + undefined (UBSan) + integer] [focal]'
# << : *GLOBAL_TASK_TEMPLATE
# container:
# image: ubuntu:focal
# env:
# FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"

# task:
# name: '[no depends, sanitizers: fuzzer,address,undefined] [focal]'
# << : *GLOBAL_TASK_TEMPLATE
# container:
# image: ubuntu:focal
# env:
# FILE_ENV: "./ci/test/00_setup_env_native_fuzz.sh"

# task:
# name: '[multiprocess] [focal]'
# << : *GLOBAL_TASK_TEMPLATE
# container:
# image: ubuntu:focal
# env:
# FILE_ENV: "./ci/test/00_setup_env_native_multiprocess.sh"

# task:
# name: '[no wallet] [bionic]'
# << : *GLOBAL_TASK_TEMPLATE
# container:
# image: ubuntu:bionic
# env:
# FILE_ENV: "./ci/test/00_setup_env_native_nowallet.sh"

# task:
# name: 'macOS 10.14 [gui, no tests] [bionic]'
# << : *GLOBAL_TASK_TEMPLATE
# container:
# image: ubuntu:bionic
# env:
# FILE_ENV: "./ci/test/00_setup_env_mac.sh"

# task:
# name: 'macOS 10.15 native [gui] [no depends]'
# macos_brew_addon_script:
# - brew install boost libevent berkeley-db4 qt miniupnpc ccache zeromq qrencode sqlite libtool automake pkg-config gnu-getopt
# << : *GLOBAL_TASK_TEMPLATE
# osx_instance:
# # Use latest image, but hardcode version to avoid silent upgrades (and breaks)
# image: catalina-xcode-12.1 # https://cirrus-ci.org/guide/macOS
# env:
# DANGER_RUN_CI_ON_HOST: "true"
# CI_USE_APT_INSTALL: "no"
# PACKAGE_MANAGER_INSTALL: "echo" # Nothing to do
# FILE_ENV: "./ci/test/00_setup_env_mac_host.sh"
66 changes: 0 additions & 66 deletions .travis.yml

This file was deleted.

14 changes: 7 additions & 7 deletions ci/lint/04_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

export LC_ALL=C

travis_retry sudo apt update && sudo apt install -y clang-format-9
sudo update-alternatives --install /usr/bin/clang-format clang-format $(which clang-format-9 ) 100
sudo update-alternatives --install /usr/bin/clang-format-diff clang-format-diff $(which clang-format-diff-9) 100
${CI_RETRY_EXE} apt update && apt install -y clang-format-9 python3-pip curl git
update-alternatives --install /usr/bin/clang-format clang-format $(which clang-format-9 ) 100
update-alternatives --install /usr/bin/clang-format-diff clang-format-diff $(which clang-format-diff-9) 100

travis_retry pip3 install codespell==1.17.1
travis_retry pip3 install flake8==3.8.3
travis_retry pip3 install yq
travis_retry pip3 install mypy==0.781
${CI_RETRY_EXE} pip3 install codespell==1.17.1
${CI_RETRY_EXE} pip3 install flake8==3.8.3
${CI_RETRY_EXE} pip3 install yq
${CI_RETRY_EXE} pip3 install mypy==0.781

SHELLCHECK_VERSION=v0.7.1
curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/
Expand Down
2 changes: 1 addition & 1 deletion ci/lint/05_before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@

export LC_ALL=C

git fetch --unshallow
git fetch
Loading