[go: up one dir, main page]

rug 1.6.0

Arbitrary-precision integers, rational, floating-point and complex numbers based on GMP, MPFR and MPC
Documentation
# Copyright © 2016–2019 University of Malta

# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.

stages:
  - clibs
  - test

before_script:
  - getconf LONG_BIT
  - rustup --version
  - if [ -n "$TOOLCHAIN" ]; then rustup install $TOOLCHAIN; fi
  - if [[ "$TOOLCHAIN" == beta* ]]; then rustup component add --toolchain $TOOLCHAIN rustfmt clippy; fi
  - if [ -d cargo/registry/cache ]; then rm -rf $CARGO_HOME/registry/cache && mkdir -p $CARGO_HOME/registry && cp -R cargo/registry/cache $CARGO_HOME/registry/ && echo Copied registry/cache; fi
  - (if cd $CARGO_HOME/registry && [ -d cache ]; then find cache -name \*.crate; fi)
  - export GMP_MPFR_SYS_CACHE=$CI_PROJECT_DIR/gmp-mpfr-sys-cache

after_script:
  - (cd $CARGO_HOME/registry && find cache -name \*.crate)
  - rm -rf cargo
  - mkdir -p cargo/registry
  - cp -R $CARGO_HOME/registry/cache cargo/registry/ && echo Updated registry/cache

clibs-x86_64-gnulinux:
  image: amd64/rust:1
  stage: clibs
  cache:
    key: $CI_JOB_NAME
    paths:
    - cargo/
    - gmp-mpfr-sys-cache/
  script:
  - cargo fetch
  - cargo test --no-default-features --features "gmp-mpfr-sys/mpc gmp-mpfr-sys/ctest" -p gmp-mpfr-sys
  artifacts:
    paths:
    - cargo/
    - gmp-mpfr-sys-cache/
    expire_in: 1 day

beta-x86_64-gnulinux:
  image: amd64/rust:1
  stage: test
  dependencies:
  - clibs-x86_64-gnulinux
  variables:
    TOOLCHAIN: beta-x86_64
  script:
  - etc/test-gitlab-ci.sh

stable-x86_64-gnulinux:
  image: amd64/rust:1
  stage: test
  dependencies:
  - clibs-x86_64-gnulinux
  variables:
    TOOLCHAIN: stable-x86_64
  script:
  - etc/test-gitlab-ci.sh

nightly-x86_64-gnulinux:
  image: amd64/rust:1
  stage: test
  dependencies:
  - clibs-x86_64-gnulinux
  variables:
    TOOLCHAIN: nightly-x86_64
  script:
  - etc/test-gitlab-ci.sh

1.31.1-x86_64-gnulinux:
  image: amd64/rust:1
  stage: test
  dependencies:
  - clibs-x86_64-gnulinux
  variables:
    TOOLCHAIN: 1.31.1-x86_64
  script:
  - etc/test-gitlab-ci.sh

1.31.1-x86_64-gnulinux-tarpaulin:
  image: amd64/rust:1
  stage: test
  cache:
    key: $CI_JOB_NAME
    paths:
    - cargo/
  dependencies:
  - clibs-x86_64-gnulinux
  variables:
    TOOLCHAIN: 1.31.1-x86_64
    REQ_COVERAGE: "77.0"
  script:
  # build tarpaulin using stable, as it does not compile with 1.31.1
  - cargo install --version 0.8.5 cargo-tarpaulin
  - etc/extract-doc-tests.sh
  # invoke-tarpaulin.sh uses the 1.31.1 toolchain
  - stdbuf -oL etc/invoke-tarpaulin.sh | tee tarpaulin.log
  - etc/extract-doc-tests.sh restore
  - echo "Check that coverage not less than $REQ_COVERAGE%"
  - tail -1 tarpaulin.log | awk '{ if ($1 < '$REQ_COVERAGE') { exit 1 } }'

stable-x86_64-gnulinux-valgrind:
  image: amd64/rust:1
  stage: test
  dependencies:
  - clibs-x86_64-gnulinux
  variables:
    TOOLCHAIN: stable-x86_64
    VALGRIND_OPTIONS: --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all --error-exitcode=1 --suppressions=etc/dlsym.supp
  script:
  - apt-get update -qq && apt-get install -y -qq valgrind
  - etc/extract-doc-tests.sh
  - cargo +$TOOLCHAIN test --features serde --lib
  - valgrind $VALGRIND_OPTIONS "$(ls target/debug/deps/rug* | grep -v '\.d')"
  - cargo +$TOOLCHAIN test --release --features serde --lib
  - valgrind $VALGRIND_OPTIONS "$(ls target/release/deps/rug* | grep -v '\.d')"
  - etc/extract-doc-tests.sh restore

clibs-i686-gnulinux:
  image: i386/rust:1
  stage: clibs
  cache:
    key: $CI_JOB_NAME
    paths:
    - cargo/
    - gmp-mpfr-sys-cache/
  script:
  - cargo fetch
  - cargo test --no-default-features --features "gmp-mpfr-sys/mpc gmp-mpfr-sys/ctest" -p gmp-mpfr-sys
  artifacts:
    paths:
    - cargo/
    - gmp-mpfr-sys-cache/
    expire_in: 1 day

beta-i686-gnulinux:
  image: i386/rust:1
  stage: test
  dependencies:
  - clibs-i686-gnulinux
  variables:
    TOOLCHAIN: beta-i686
  script:
  - etc/test-gitlab-ci.sh

stable-i686-gnulinux:
  image: i386/rust:1
  stage: test
  dependencies:
  - clibs-i686-gnulinux
  variables:
    TOOLCHAIN: stable-i686
  script:
  - etc/test-gitlab-ci.sh

nightly-i686-gnulinux:
  image: i386/rust:1
  stage: test
  dependencies:
  - clibs-i686-gnulinux
  variables:
    TOOLCHAIN: nightly-i686
  script:
  - etc/test-gitlab-ci.sh

1.31.1-i686-gnulinux:
  image: i386/rust:1
  stage: test
  dependencies:
  - clibs-i686-gnulinux
  variables:
    TOOLCHAIN: 1.31.1-i686
  script:
  - etc/test-gitlab-ci.sh

stable-i686-gnulinux-valgrind:
  image: i386/rust:1
  stage: test
  dependencies:
  - clibs-i686-gnulinux
  variables:
    TOOLCHAIN: stable-i686
    VALGRIND_OPTIONS: --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all --error-exitcode=1 --suppressions=etc/dlsym.supp
  script:
  - apt-get update -qq && apt-get install -y -qq valgrind
  - etc/extract-doc-tests.sh
  - cargo +$TOOLCHAIN test --features serde --lib
  - valgrind $VALGRIND_OPTIONS "$(ls target/debug/deps/rug* | grep -v '\.d')"
  - cargo +$TOOLCHAIN test --release --features serde --lib
  - valgrind $VALGRIND_OPTIONS --suppressions=etc/i686-release.supp "$(ls target/release/deps/rug* | grep -v '\.d')"
  - etc/extract-doc-tests.sh restore