diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 00000000..531ce9a5 --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,41 @@ +on: [push, pull_request] + +name: Continuous integration + +jobs: + Tests: + name: Tests + runs-on: ubuntu-latest + strategy: + matrix: + include: + - rust: stable + env: + DO_COV: true + AS_DEPENDENCY: true + - rust: beta + env: + AS_DEPENDENCY: true + - rust: nightly + env: + DO_FUZZ: true + DO_BENCH: true + AS_DEPENDENCY: true + - rust: 1.29.0 + env: + AS_DEPENDENCY: true + PIN_VERSIONS: true + steps: + - name: Install test dependencies + run: sudo apt-get install -y binutils-dev libunwind8-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc libiberty-dev + - name: Checkout Crate + uses: actions/checkout@v2 + - name: Checkout Toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - name: Running test script + env: ${{ matrix.env }} + run: ./contrib/test.sh \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c841fa31..00000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -language: rust -cache: cargo - -addons: - apt: - update: true - packages: - - binutils-dev - - libunwind8-dev - - libcurl4-openssl-dev - - libelf-dev - - libdw-dev - - cmake - - gcc - - libiberty-dev - - -matrix: - include: - - rust: stable - env: DO_FUZZ=true DO_COV=true AS_DEPENDENCY=true - - rust: beta - env: AS_DEPENDENCY=true - - rust: nightly - env: DO_BENCH=true AS_DEPENDENCY=true - - rust: 1.29.0 - env: AS_DEPENDENCY=true - -script: - - ./contrib/test.sh - -after_success: | - if [ "$DO_COV" = true ]; then - wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz && - tar xzf master.tar.gz && - cd kcov-master && - mkdir build && - cd build && - cmake .. && - make && - make install DESTDIR=../../kcov-build && - cd ../.. && - rm -rf kcov-master && - for file in target/debug/bitcoin-*; do [ -x "${file}" ] || continue; mkdir -p "target/cov/$(basename $file)"; ./kcov-build/usr/local/bin/kcov --exclude-pattern=/.cargo,/usr/lib --verify "target/cov/$(basename $file)" "$file"; done && - bash <(curl -s https://codecov.io/bash) && - echo "Uploaded code coverage"; fi diff --git a/contrib/test.sh b/contrib/test.sh index 00d5f6fa..b4bf59dd 100755 --- a/contrib/test.sh +++ b/contrib/test.sh @@ -3,7 +3,7 @@ FEATURES="base64 bitcoinconsensus use-serde rand" # Pin `cc` for Rust 1.29 -if [ "$TRAVIS_RUST_VERSION" = "1.29.0" ]; then +if [ -n "$PIN_VERSIONS" ]; then cargo generate-lockfile --verbose cargo update -p cc --precise "1.0.41" --verbose cargo update -p serde --precise "1.0.98" --verbose @@ -57,7 +57,7 @@ then echo 'bitcoin = { path = "..", features = ["use-serde"] }' >> Cargo.toml # Pin `cc` for Rust 1.29 - if [ "$TRAVIS_RUST_VERSION" = "1.29.0" ]; then + if [ -n "$PIN_VERSIONS" ]; then cargo generate-lockfile --verbose cargo update -p cc --precise "1.0.41" --verbose cargo update -p serde --precise "1.0.98" --verbose