rspec/.cirrus.yml

138 lines
4.0 KiB
YAML
Raw Normal View History

2020-06-23 11:33:04 +02:00
env:
GITHUB_TOKEN: VAULT[development/github/token/${CIRRUS_REPO_OWNER}-${CIRRUS_REPO_NAME}-ro token]
2023-05-26 15:29:37 +02:00
SONAR_HOST_URL: VAULT[development/kv/data/next data.url]
SONAR_TOKEN: VAULT[development/kv/data/next data.token]
SONAR_SCANNER_VERSION: 5.0.1.3006
SONAR_SCANNER_HOME: ${HOME}/.sonar/sonar-scanner-${SONAR_SCANNER_VERSION}-linux
PATH: ${SONAR_SCANNER_HOME}/bin:$PATH
# Need to clone full depth to track the changed files: for SQ analysis and for validation tasks
CIRRUS_CLONE_DEPTH: 0
2020-06-23 11:33:04 +02:00
# Use bash (instead of sh on linux or cmd.exe on windows)
CIRRUS_SHELL: bash
BASE_BRANCH: ${CIRRUS_BASE_BRANCH}
DEFAULT_BRANCH: ${CIRRUS_DEFAULT_BRANCH}
2020-06-23 11:33:04 +02:00
2020-06-23 11:33:04 +02:00
container_definition: &CONTAINER_DEFINITION
2022-12-13 23:03:18 +01:00
cluster_name: ${CIRRUS_CLUSTER_NAME}
builder_role: cirrus-builder
builder_image: docker-builder-v*
builder_instance_type: t3.small
builder_subnet_id: ${CIRRUS_AWS_SUBNET}
region: eu-central-1
2020-06-23 11:33:04 +02:00
namespace: default
use_in_memory_disk: true
setup_sonar_scanner: &SETUP_SONAR_SCANNER
setup_sonar_scanner_script:
- apt update -y && apt upgrade -y && apt update -y && apt install -y unzip
- curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
- unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
2021-06-08 15:21:29 +02:00
tooling_tests_task:
2022-12-13 23:03:18 +01:00
eks_container:
2021-06-08 15:21:29 +02:00
<<: *CONTAINER_DEFINITION
dockerfile: ci/Dockerfile
cpu: 1
memory: 2G
env:
PYTHONPATH: .
install_dependencies_script:
- ci/install_rspec_tools_dependencies.sh
tests_script:
- bash ci/fetch_branches.sh
- cd rspec-tools
- pipenv run pytest --cov=rspec_tools --cov-report=xml
<<: *SETUP_SONAR_SCANNER
analyze_script:
- cd rspec-tools
- sonar-scanner
2021-06-08 15:21:29 +02:00
frontend_tests_task:
2022-12-13 23:03:18 +01:00
eks_container:
2021-06-08 15:21:29 +02:00
<<: *CONTAINER_DEFINITION
dockerfile: ci/frontend-tests-dockerfile
cpu: 1
memory: 3G
2021-06-08 15:21:29 +02:00
node_modules_cache:
folder: frontend/node_modules
reupload_on_changes: false # since there is a fingerprint script
fingerprint_script:
- echo $CIRRUS_OS
- node --version
- cat frontend/package-lock.json
populate_script:
- cd frontend
- npm install
tests_script:
- bash ci/fetch_branches.sh
2021-06-08 15:21:29 +02:00
- cd frontend
- npm run build
- npm test -- --detectOpenHandles --coverage .
<<: *SETUP_SONAR_SCANNER
analyze_script:
- cd frontend
- sonar-scanner
2021-06-08 15:21:29 +02:00
validate_ci_tests_task:
skip: "!changesInclude('ci_tests/**', 'ci/**')"
eks_container:
<<: *CONTAINER_DEFINITION
dockerfile: ci/Dockerfile
cpu: 1
memory: 2G
ci_tests_script:
- ./ci_tests/asciidoc_validation/run_tests.sh
validate_rules_task:
2022-12-13 23:03:18 +01:00
eks_container:
<<: *CONTAINER_DEFINITION
dockerfile: ci/Dockerfile
cpu: 1
memory: 2G
metadata_validation_script:
- ./ci/validate_metadata.sh
file_extensions_validation_script:
- ./ci/validate_file_extensions.sh
asciidoc_validation_script:
2021-06-08 15:21:29 +02:00
- ./ci/validate_asciidoc.sh
validate_links_task:
timeout_in: 120m
execution_lock: RSPEC_validate_links
2022-12-13 23:03:18 +01:00
eks_container:
2021-06-08 15:21:29 +02:00
<<: *CONTAINER_DEFINITION
dockerfile: ci/Dockerfile
2020-06-23 11:33:04 +02:00
cpu: 1
memory: 2G
env:
LINK_CACHE_NAME: link-probing-status
LINK_CACHE_PATH: /root/link-probing-history.cache
cache_download_script:
- bash ci/cirrus-cache.sh download ${LINK_CACHE_NAME} ${LINK_CACHE_PATH}
- md5sum /root/link-probing-history.cache/link_probes.history || true
tests_script:
2021-06-08 15:21:29 +02:00
- ./ci/validate_links.sh ${LINK_CACHE_PATH}
always:
cache_upload_script:
- md5sum /root/link-probing-history.cache/link_probes.history || true
- bash ci/cirrus-cache.sh upload ${LINK_CACHE_NAME} ${LINK_CACHE_PATH}
all_required_checks_task:
depends_on:
- tooling_tests
- frontend_tests
- validate_rules
- validate_ci_tests
2022-12-13 23:03:18 +01:00
eks_container:
<<: *CONTAINER_DEFINITION
dockerfile: ci/Dockerfile
cpu: 1
memory: 1G
clone_script:
- echo 'This is a dummy task used to wait on other tasks. Clone is not necessary.'
print_message_script:
- echo 'All required checks have passed'