.gitlab-ci.yml 3.84 KB
Newer Older
Denis_P's avatar
Denis_P committed
# .gitlab-ci.yml
#
# ink
#
# pipelines can be triggered manually in the web


stages:
Denis_P's avatar
Denis_P committed
  - check-workspace
  - examples
Denis_P's avatar
Denis_P committed

variables:
  GIT_STRATEGY:                    fetch
  CARGO_HOME:                      "/ci-cache/${CI_PROJECT_NAME}/cargo/${CI_JOB_NAME}"
  SCCACHE_DIR:                     "/ci-cache/${CI_PROJECT_NAME}/sccache"
  CARGO_INCREMENTAL:               0
  CI_SERVER_NAME:                  "GitLab CI"
  RUSTFLAGS:                       "-C link-dead-code"
Denis_P's avatar
Denis_P committed
  REGISTRY:                        registry.parity.io/parity/infrastructure/scripts
Denis_P's avatar
Denis_P committed

.collect-artifacts:                &collect-artifacts
  artifacts:
    name:                          "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
    when:                          on_success
    expire_in:                     7 days
    paths:
      - artifacts/

.docker-env:                       &docker-env
Denis_P's avatar
Denis_P committed
  image:                           ${REGISTRY}/ink-ci-linux:latest
Denis_P's avatar
Denis_P committed
  before_script:
Denis_P's avatar
Denis_P committed
    - cargo -vV
    - rustc -vV
Denis_P's avatar
Denis_P committed
    - rustup show
Denis_P's avatar
Denis_P committed
    - bash --version
Denis_P's avatar
Denis_P committed
    - sccache -s
  only:
    - master
    - /^v[0-9]+\.[0-9]+.*$/        # i.e. v1.0, v2.1rc1
    - schedules
    - web
    - /^[0-9]+$/                   # PRs
  tags:
    - linux-docker

Denis_P's avatar
Denis_P committed
#### stage:                        check-workspace
Denis_P's avatar
Denis_P committed

Denis_P's avatar
Denis_P committed
kcov:
Denis_P's avatar
Denis_P committed
  stage:                           check-workspace
  <<:                              *docker-env
  script:
    - |
      ./scripts/check-workspace.sh
      check_workspace=$?

      if [ $check_workspace -eq 0 ]
      then
        # Execute and upload kcov results
        cargo kcov --verbose --coveralls --all --no-clean-rebuild
        kcov=$?
        bash <(curl -s https://codecov.io/bash)
      fi

Denis_P's avatar
Denis_P committed
cargo-check-af:
  stage:                           check-workspace
Denis_P's avatar
Denis_P committed
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
  - time cargo check --verbose --all --all-features

cargo-check-nf:
  stage:                           check-workspace
Denis_P's avatar
Denis_P committed
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
  - time cargo check --verbose --all --no-default-features
Denis_P's avatar
Denis_P committed

cargo-fmt:
  stage:                           check-workspace
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
  - time cargo fmt --verbose --all -- --check
Denis_P's avatar
Denis_P committed

cargo-clippy-af:
  stage:                           check-workspace
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
  - time cargo clippy --verbose --all --all-features -- -D warnings
Denis_P's avatar
Denis_P committed

cargo-clippy-nf:
  stage:                           check-workspace
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
  - time cargo clippy --verbose --all --no-default-features -- -D warnings
Denis_P's avatar
Denis_P committed

cargo-test-af:
  stage:                           check-workspace
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
  - time cargo test --verbose --all --all-features
Denis_P's avatar
Denis_P committed

Denis_P's avatar
Denis_P committed
cargo-build-nf:
  stage:                           check-workspace
Denis_P's avatar
Denis_P committed
  <<:                              *docker-env
  script:
Denis_P's avatar
Denis_P committed
  - time cargo build --verbose --all --no-default-features --release --target=wasm32-unknown-unknown

Denis_P's avatar
Denis_P committed
#### stage:                        examples
Denis_P's avatar
Denis_P committed

Denis_P's avatar
Denis_P committed
examples-wasm:
Denis_P's avatar
Denis_P committed
  stage:                           examples
Denis_P's avatar
Denis_P committed
  <<:                              *docker-env
  script:
    - for example in $(ls examples/lang); do
        time cargo build --release --no-default-features --target=wasm32-unknown-unknown --verbose --manifest-path examples/lang/$example/Cargo.toml;
      done
Denis_P's avatar
Denis_P committed
    - sccache -s
Denis_P's avatar
Denis_P committed

examples-test:
Denis_P's avatar
Denis_P committed
  stage:                           examples
Denis_P's avatar
Denis_P committed
  <<:                              *docker-env
  script:
    - for example in $(ls examples/lang); do
        time cargo test --verbose --manifest-path examples/lang/$example/Cargo.toml;
      done
Denis_P's avatar
Denis_P committed
    - sccache -s
Denis_P's avatar
Denis_P committed

examples-abi:
Denis_P's avatar
Denis_P committed
  stage:                           examples
Denis_P's avatar
Denis_P committed
  <<:                              *docker-env
  script:
    - for example in $(ls examples/lang); do
        time cargo run --package abi-gen --manifest-path examples/lang/$example/Cargo.toml;
      done
Denis_P's avatar
Denis_P committed
    - sccache -s