Skip to content

Commit

Permalink
Migrate tests to GH-Actions
Browse files Browse the repository at this point in the history
Incomplete: Linux 32-bit, Big-Endian, Web
  • Loading branch information
dhardy committed Dec 8, 2020
1 parent bf75be1 commit e9d6295
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 134 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -23,3 +23,102 @@ jobs:
env: RUSTDOCFLAGS: --cfg doc_cfg
# --all builds all crates, but with default features for other crates (okay in this case)
run: cargo deadlinks --ignore-fragments -- --all --features nightly,serde1,getrandom,small_rng

test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
toolchain: []
minimal: [false]
include:
- toolchain: [stable]
- os: ubuntu-latest
toolchain: [beta, 1.36.0, nightly]
- os: ubuntu-latest
minimal: true

steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
- name: Maybe minimal
if ${{ matrix.minimal }}
run: cargo generate-lockfile -Z minimal-versions
- name: Maybe nightly
if ${{ matrix.toolchain == 'nightly' }}
run: |
cargo test --tests --features=nightly
cargo test --all-features
cargo test --benches --features=nightly
cargo test --manifest-path rand_distr/Cargo.toml --benches
- name: Test rand
run: |
cargo test --tests --no-default-features
cargo test --tests --no-default-features --features=alloc,getrandom,small_rng
# all stable features:
cargo test --features=serde1,log,small_rng
cargo test --examples
- name: Test rand_core
run: |
cargo test --manifest-path rand_core/Cargo.toml
cargo test --manifest-path rand_core/Cargo.toml --no-default-features
cargo test --manifest-path rand_core/Cargo.toml --no-default-features --features=alloc,getrandom
- name: Test rand_distr
run: cargo test --manifest-path rand_distr/Cargo.toml
- name: Test rand_pcg
run: cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1
- name: Test rand_chacha
run: cargo test --manifest-path rand_chacha/Cargo.toml
- name: Test rand_hc
run: cargo test --manifest-path rand_hc/Cargo.toml

test-miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install toolchain
run: |
MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)
rustup default "$MIRI_NIGHTLY"
- name: Test rand
run: |
cargo miri test --no-default-features
cargo miri test --features=log,small_rng
cargo miri test --manifest-path rand_core/Cargo.toml
cargo miri test --manifest-path rand_core/Cargo.toml --features=serde1
cargo miri test --manifest-path rand_core/Cargo.toml --no-default-features
#cargo miri test --manifest-path rand_distr/Cargo.toml # no unsafe and lots of slow tests
cargo miri test --manifest-path rand_pcg/Cargo.toml --features=serde1
cargo miri test --manifest-path rand_chacha/Cargo.toml --no-default-features
cargo miri test --manifest-path rand_hc/Cargo.toml
test-no-std:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: thumbv6m-none-eabi
override: true
- name: Build top-level only
run: cargo build --target=thumbv6m-none-eabi --no-default-features

test-no-std:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: aarch64-apple-ios
override: true
- name: Build top-level only
run: cargo build --target=aarch64-apple-ios
68 changes: 0 additions & 68 deletions .travis.yml
Expand Up @@ -6,25 +6,6 @@ sudo: false

matrix:
include:
- rust: 1.36.0
name: "Linux, 1.36.0"
os: linux

- rust: stable
name: "Linux, stable"

- rust: stable
name: "OSX+iOS, stable"
os: osx
install:
- rustup target add aarch64-apple-ios
script:
- bash utils/ci/script.sh
- cargo build --target=aarch64-apple-ios

- rust: beta
name: "Linux, beta"

# This target catches endianness issues
- rust: stable
sudo: required
Expand All @@ -36,57 +17,8 @@ matrix:
- sh utils/ci/install.sh
- source ~/.cargo/env || true

# This target checks we really can build no_std binaries
- rust: nightly
name: "no_std platform test"
install:
- rustup target add thumbv6m-none-eabi
script:
# Test the top-level crate with all features:
- cargo build --target=thumbv6m-none-eabi --no-default-features

- rust: nightly
name: "Linux, nightly (32-bit test)"
env: TARGET=i686-unknown-linux-musl
install:
- rustup target add $TARGET

- rust: nightly
os: linux
name: "Miri, nightly"
script:
- sh utils/ci/miri.sh

- rust: nightly
os: linux
name: "Minimal dep versions"
script:
- cargo generate-lockfile -Z minimal-versions
- bash utils/ci/script.sh

before_install:
- set -e
- rustup self update

script:
- bash utils/ci/script.sh

after_script: set +e

# Cache: this seems to do more harm than good
#cache:
#cargo: true
#directories:
#- .local/share/cargo-web

#before_cache:
## Travis can't cache files that are not readable by "others"
#- chmod -R a+r $HOME/.cargo

env:
global:
secure: "BdDntVHSompN+Qxz5Rz45VI4ZqhD72r6aPl166FADlnkIwS6N6FLWdqs51O7G5CpoMXEDvyYrjmRMZe/GYLIG9cmqmn/wUrWPO+PauGiIuG/D2dmfuUNvSTRcIe7UQLXrfP3yyfZPgqsH6pSnNEVopquQKy3KjzqepgriOJtbyY="

notifications:
email:
on_success: never
48 changes: 0 additions & 48 deletions appveyor.yml

This file was deleted.

18 changes: 0 additions & 18 deletions utils/ci/miri.sh

This file was deleted.

0 comments on commit e9d6295

Please sign in to comment.