diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 78f7d57ce..000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,237 +0,0 @@ -stages: - - check - - test - - nightly-test - - build - - publish - -default: - interruptible: true - retry: - max: 2 - when: - - runner_system_failure - - unknown_failure - - api_failure - -variables: - CI_IMAGE: "paritytech/ci-unified:bullseye-1.74.0-2023-11-01-v20231204" - # BUILDAH_IMAGE is defined in group variables - BUILDAH_COMMAND: "buildah --storage-driver overlay2" - -.common-refs: &common-refs - rules: - - if: $CI_PIPELINE_SOURCE == "schedule" - when: never - - if: $CI_PIPELINE_SOURCE == "web" - - if: $CI_COMMIT_REF_NAME == "main" - - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - -.publish-refs: &publish-refs - rules: - - if: '$CI_PIPELINE_SOURCE == "schedule"' - when: never - - if: $CI_COMMIT_REF_NAME == "main" - - if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1 - -.rust-info-script: &rust-info-script - - rustup show - - cargo --version - - rustup +nightly show - - cargo +nightly --version - - bash --version - -.docker-env: &docker-env - image: "${CI_IMAGE}" - before_script: - - *rust-info-script - tags: - - linux-docker-vm-c2 - -.kubernetes-env: &kubernetes-env - image: "${CI_IMAGE}" - tags: - - kubernetes-parity-build - -.collect-artifacts: &collect-artifacts - artifacts: - name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}" - when: on_success - expire_in: 1 days - paths: - - ./artifacts/ - -#### stage: check - -fmt: - stage: check - <<: *docker-env - <<: *common-refs - script: - - cargo +nightly fmt --all -- --check - -clippy: - stage: check - <<: *docker-env - <<: *common-refs - script: - - cargo clippy --all-targets - -check-docs: - stage: check - <<: *docker-env - <<: *common-refs - script: - - RUSTDOCFLAGS="--cfg docsrs --deny rustdoc::broken_intra_doc_links" - cargo doc --verbose --workspace --no-deps --document-private-items --all-features - -check-code: - stage: check - <<: *docker-env - <<: *common-refs - script: - - cargo install cargo-hack - - cargo hack check --workspace --each-feature --all-targets - -check-staking-miner-playground: - stage: check - <<: *docker-env - <<: *common-refs - script: - - rustup target add wasm32-unknown-unknown --toolchain nightly - - cargo +nightly install wasm-gc - - cargo check --manifest-path staking-miner-playground/Cargo.toml - -### stage: test - -test-ubuntu: - stage: test - needs: [] - <<: *docker-env - <<: *common-refs - script: - - RUST_LOG=info cargo test --workspace -- --nocapture - -### stage: nightly-test - -nightly-test: - stage: nightly-test - <<: *docker-env - rules: - - if: $CI_PIPELINE_SOURCE == "schedule" - script: - - git clone -b master --depth 1 https://github.com/paritytech/polkadot-sdk.git polkadot-sdk - - cd polkadot-sdk - - cargo build -p polkadot --release --features fast-runtime - - mkdir -p ~/.local/bin - - mv ./target/release/polkadot /usr/bin - - mv ./target/release/polkadot-execute-worker /usr/bin - - mv ./target/release/polkadot-prepare-worker /usr/bin - - polkadot --version - - cd - - - rm -rf polkadot - - cd staking-miner-playground - - cargo build --release --features test-trimming - - mv ./target/release/staking-miner-playground /usr/bin - - staking-miner-playground --version - - cd - - - RUST_LOG=info cargo test --workspace --all-features -- --nocapture - - cargo clean - after_script: - - echo $CI_JOB_STATUS > nightly_test_result - artifacts: - when: always - paths: - - nightly_test_result - -nightly-test-notification: - stage: nightly-test - image: paritytech/tools:latest - rules: - - if: $CI_PIPELINE_SOURCE == "schedule" - needs: ["nightly-test"] - when: always - script: - - \[ ! -f nightly_test_result \] && TEST_JOB_STATUS=failed || TEST_JOB_STATUS=$(" or tag - - if [[ $CI_COMMIT_REF_NAME == "main" ]]; - then - export VERSION=main-${CI_COMMIT_SHORT_SHA}; - else - export VERSION=$CI_COMMIT_REF_NAME; - fi - - test "$DOCKER_USER" -a "$DOCKER_PASS" || - ( echo "no docker credentials provided"; exit 1 ) - - cd ./artifacts - - $BUILDAH_COMMAND build - --format=docker - --build-arg VCS_REF="${CI_COMMIT_SHA}" - --build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')" - --build-arg IMAGE_NAME="${IMAGE_NAME}" - --tag "$IMAGE_NAME:latest" - --tag "$IMAGE_NAME:$VERSION" - --file Dockerfile . - # The job will success only on the protected branch - - echo "$DOCKER_PASS" | - buildah login --username "$DOCKER_USER" --password-stdin docker.io - - $BUILDAH_COMMAND info - - $BUILDAH_COMMAND push --format=v2s2 "$IMAGE_NAME:latest" - - $BUILDAH_COMMAND push --format=v2s2 "$IMAGE_NAME:$VERSION" - after_script: - - buildah logout --all - -publish-docker-image-description: - stage: publish - <<: *kubernetes-env - image: paritytech/dockerhub-description - variables: - DOCKER_USERNAME: $Docker_Hub_User_Parity - DOCKER_PASSWORD: $Docker_Hub_Pass_Parity - README_FILEPATH: $CI_PROJECT_DIR/Dockerfile.README.md - DOCKERHUB_REPOSITORY: paritytech/staking-miner-v2 - SHORT_DESCRIPTION: "staking-miner-v2" - rules: - - if: $CI_COMMIT_REF_NAME == "main" - changes: - - Dockerfile.README.md - script: - - cd / && sh entrypoint.sh