include: - template: Code-Quality.gitlab-ci.yml - template: Dependency-Scanning.gitlab-ci.yml - template: License-Scanning.gitlab-ci.yml - template: SAST.gitlab-ci.yml - template: Secret-Detection.gitlab-ci.yml stages: - python-test - build - dockerize - test build-mainnet: stage: build script: - rm -rf .git/modules/docs .git/modules/libraries/fc ./docs ./libraries/fc - git submodule sync - git submodule update --init --recursive - rm -rf build - mkdir build - cd build - cmake -DCMAKE_BUILD_TYPE=Release .. - make -j$(nproc) artifacts: untracked: true paths: - build/libraries/ - build/programs/ - build/tests/ tags: - builder test-mainnet: stage: test dependencies: - build-mainnet script: - ./build/libraries/fc/tests/all_tests - ./build/tests/betting_test --log_level=message - ./build/tests/chain_test --log_level=message - ./build/tests/cli_test --log_level=message tags: - builder dockerize-mainnet: stage: dockerize variables: IMAGE: $CI_REGISTRY_IMAGE/mainnet/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA before_script: - docker info - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - docker build --no-cache -t $IMAGE . - docker push $IMAGE after_script: - docker rmi $IMAGE tags: - builder timeout: 3h build-testnet: stage: build script: - rm -rf .git/modules/docs .git/modules/libraries/fc ./docs ./libraries/fc - git submodule sync - git submodule update --init --recursive - rm -rf build - mkdir build - cd build - cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_PEERPLAYS_TESTNET=1 .. - make -j$(nproc) artifacts: untracked: true paths: - build/libraries/ - build/programs/ - build/tests/ tags: - builder when: manual timeout: 3h test-testnet: stage: test dependencies: - build-testnet script: - ./build/libraries/fc/tests/all_tests - ./build/tests/betting_test --log_level=message - ./build/tests/chain_test --log_level=message - ./build/tests/cli_test --log_level=message tags: - builder when: manual timeout: 1h dockerize-testnet: stage: dockerize variables: IMAGE: $CI_REGISTRY_IMAGE/testnet/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA before_script: - docker info - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - docker build --no-cache -t $IMAGE . - docker push $IMAGE after_script: - docker rmi $IMAGE tags: - builder when: manual timeout: 3h test-e2e: stage: python-test variables: IMAGE: registry.gitlab.com/pbsa/peerplays/mainnet/feature-python-e2e-tests:943e02cdcd9fb8a90137851635b998cf1b4f622c before_script: - docker info - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY script: - git clone https://gitlab.com/PBSA/tools-libs/peerplays-utils.git - cd peerplays-utils/peerplays-qa-environment - git checkout origin/feature/python-e2e-tests-for-CI - cd e2e-tests/ - python3 -m venv venv - source venv/bin/activate - pip3 install -r requirements.txt - python3 main.py --stop - docker ps -a - docker pull $IMAGE - export COMPOSE_SERVICE_PEERPLAYS_BASE_IMAGE=$IMAGE - python3 main.py --start btc hive eth - python3 main.py --start pp - docker ps -a - python3 main.py --stop - deactivate - docker ps -a tags: - python-tests