From 72b8820f8665ddf9b5fe70391f2c4bc92fa613d3 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Tue, 8 Dec 2020 10:44:16 +0000 Subject: [PATCH 01/20] GitHub Actions: add GitHub pages deployment --- .github/workflows/gh-pages.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/test.yml | 25 +++++++++++++++++++++++++ .travis.yml | 23 ----------------------- 3 files changed, 53 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/gh-pages.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 00000000000..7e8a69a34ef --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,28 @@ +name: gh-pages + +on: + push: + branches: + - master + +jobs: + deploy: + name: GH-pages documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + - name: doc (rand) + env: RUSTDOCFLAGS: --cfg doc_cfg + # --all builds all crates, but with default features for other crates (okay in this case) + run: cargo doc --all --features nightly,serde1,getrandom,small_rng + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./target/doc diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000000..b1b51c22d89 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,25 @@ +name: Tests + +on: + push: + branches: [ master, '0.[0-9]+' ] + pull_request: + branches: [ master, '0.[0-9]+' ] + +jobs: + check-doc: + name: Check doc + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + override: true + run: cargo install cargo-deadlinks + - name: doc (rand) + 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 diff --git a/.travis.yml b/.travis.yml index 35d755e3527..82093929ca7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,29 +25,6 @@ matrix: - rust: beta name: "Linux, beta" - - rust: nightly - os: linux - name: "Linux, nightly, docs" - env: NIGHTLY=1 - install: - - cargo --list | egrep "^\s*deadlinks$" -q || cargo install cargo-deadlinks - - cargo deadlinks -V - before_script: - - pip install 'travis-cargo<0.2' --user && export PATH=$HOME/.local/bin:$PATH - script: - - bash utils/ci/script.sh - # remove cached documentation, otherwise files from previous PRs can get included - - rm -rf target/doc - - cargo doc --no-deps --all --all-features - - cargo deadlinks --dir target/doc - deploy: - local_dir: target/doc - provider: pages - skip_cleanup: true - github_token: $GITHUB_TOKEN - on: - branch: master - # This target catches endianness issues - rust: stable sudo: required From d0075d6b903fdfa6c08d4a22acf977a41e87c0be Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Tue, 8 Dec 2020 11:56:08 +0000 Subject: [PATCH 02/20] Cargo.toml: remove [badges] sections According to the Cargo manifest, this section is not used and the README should be used for build status. --- Cargo.toml | 4 ---- rand_chacha/Cargo.toml | 4 ---- rand_core/Cargo.toml | 4 ---- rand_distr/Cargo.toml | 4 ---- rand_hc/Cargo.toml | 4 ---- rand_pcg/Cargo.toml | 4 ---- 6 files changed, 24 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9284f3084fd..b6e87bab282 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,10 +16,6 @@ autobenches = true edition = "2018" include = ["src/", "LICENSE-*", "README.md", "CHANGELOG.md", "COPYRIGHT"] -[badges] -travis-ci = { repository = "rust-random/rand" } -appveyor = { repository = "rust-random/rand" } - [features] # Meta-features: default = ["std", "std_rng"] diff --git a/rand_chacha/Cargo.toml b/rand_chacha/Cargo.toml index 2a17aa172bc..703cc86ac9b 100644 --- a/rand_chacha/Cargo.toml +++ b/rand_chacha/Cargo.toml @@ -14,10 +14,6 @@ keywords = ["random", "rng", "chacha"] categories = ["algorithms", "no-std"] edition = "2018" -[badges] -travis-ci = { repository = "rust-random/rand" } -appveyor = { repository = "rust-random/rand" } - [dependencies] rand_core = { path = "../rand_core", version = "0.5" } ppv-lite86 = { version = "0.2.8", default-features = false, features = ["simd"] } diff --git a/rand_core/Cargo.toml b/rand_core/Cargo.toml index 4b85940ff70..831562689dc 100644 --- a/rand_core/Cargo.toml +++ b/rand_core/Cargo.toml @@ -14,10 +14,6 @@ keywords = ["random", "rng"] categories = ["algorithms", "no-std"] edition = "2018" -[badges] -travis-ci = { repository = "rust-random/rand" } -appveyor = { repository = "rust-random/rand" } - [features] std = ["alloc", "getrandom", "getrandom/std"] # use std library; should be default but for above bug alloc = [] # enables Vec and Box support without std diff --git a/rand_distr/Cargo.toml b/rand_distr/Cargo.toml index fe40d179110..e6dc5462c24 100644 --- a/rand_distr/Cargo.toml +++ b/rand_distr/Cargo.toml @@ -15,10 +15,6 @@ categories = ["algorithms"] edition = "2018" include = ["src/", "LICENSE-*", "README.md", "CHANGELOG.md", "COPYRIGHT"] -[badges] -travis-ci = { repository = "rust-random/rand" } -appveyor = { repository = "rust-random/rand" } - [dependencies] rand = { path = "..", version = "0.7", default-features = false } num-traits = { version = "0.2", default-features = false, features = ["libm"] } diff --git a/rand_hc/Cargo.toml b/rand_hc/Cargo.toml index 84f53f80cdd..048f9aaa208 100644 --- a/rand_hc/Cargo.toml +++ b/rand_hc/Cargo.toml @@ -14,9 +14,5 @@ keywords = ["random", "rng", "hc128"] categories = ["algorithms", "no-std"] edition = "2018" -[badges] -travis-ci = { repository = "rust-random/rand" } -appveyor = { repository = "rust-random/rand" } - [dependencies] rand_core = { path = "../rand_core", version = "0.5" } diff --git a/rand_pcg/Cargo.toml b/rand_pcg/Cargo.toml index 9eb2eaf51e1..33e65c547dd 100644 --- a/rand_pcg/Cargo.toml +++ b/rand_pcg/Cargo.toml @@ -14,10 +14,6 @@ keywords = ["random", "rng", "pcg"] categories = ["algorithms", "no-std"] edition = "2018" -[badges] -travis-ci = { repository = "rust-random/rand" } -appveyor = { repository = "rust-random/rand" } - [features] serde1 = ["serde"] From bf75be18558d1fca667854be2dd185663a607e78 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Tue, 8 Dec 2020 11:57:26 +0000 Subject: [PATCH 03/20] Update README files shields and doc --- README.md | 7 +++---- rand_chacha/README.md | 3 +-- rand_core/README.md | 3 +-- rand_distr/README.md | 3 +-- rand_hc/README.md | 3 +-- rand_pcg/README.md | 3 +-- 6 files changed, 8 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 6d1db896ddd..6db4cce8a52 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Rand -[![Build Status](https://travis-ci.org/rust-random/rand.svg?branch=master)](https://travis-ci.org/rust-random/rand) -[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/kas-gui/kas/actions) [![Crate](https://img.shields.io/crates/v/rand.svg)](https://crates.io/crates/rand) [![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand) @@ -104,8 +103,8 @@ greater, and 0.4 and 0.3 (since approx. June 2017) require Rustc version 1.15 or greater. Subsets of the Rand code may work with older Rust versions, but this is not supported. -Travis CI always has a build with a pinned version of Rustc matching the oldest -supported Rust release. The current policy is that this can be updated in any +Continuous Integration (CI) will always test the oldest supported Rustc version +(the MSRV). The current policy is that this can be updated in any Rand release if required, but the change must be noted in the changelog. ## Crate Features diff --git a/rand_chacha/README.md b/rand_chacha/README.md index b1928fd9cc8..9d5a2198a29 100644 --- a/rand_chacha/README.md +++ b/rand_chacha/README.md @@ -1,7 +1,6 @@ # rand_chacha -[![Build Status](https://travis-ci.org/rust-random/rand.svg)](https://travis-ci.org/rust-random/rand) -[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/kas-gui/kas/actions) [![Latest version](https://img.shields.io/crates/v/rand_chacha.svg)](https://crates.io/crates/rand_chacha) [![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_chacha) diff --git a/rand_core/README.md b/rand_core/README.md index 78c8083fc82..151fcd425a8 100644 --- a/rand_core/README.md +++ b/rand_core/README.md @@ -1,7 +1,6 @@ # rand_core -[![Build Status](https://travis-ci.org/rust-random/rand.svg)](https://travis-ci.org/rust-random/rand) -[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/kas-gui/kas/actions) [![Latest version](https://img.shields.io/crates/v/rand_core.svg)](https://crates.io/crates/rand_core) [![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_core) diff --git a/rand_distr/README.md b/rand_distr/README.md index 9a67e5b3f93..142ffa9ba30 100644 --- a/rand_distr/README.md +++ b/rand_distr/README.md @@ -1,7 +1,6 @@ # rand_distr -[![Build Status](https://travis-ci.org/rust-random/rand.svg?branch=master)](https://travis-ci.org/rust-random/rand) -[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/kas-gui/kas/actions) [![Latest version](https://img.shields.io/crates/v/rand_distr.svg)](https://crates.io/crates/rand_distr) [[![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_distr) diff --git a/rand_hc/README.md b/rand_hc/README.md index 4d992fec0c5..34cfa9610ac 100644 --- a/rand_hc/README.md +++ b/rand_hc/README.md @@ -1,7 +1,6 @@ # rand_hc -[![Build Status](https://travis-ci.org/rust-random/rand.svg)](https://travis-ci.org/rust-random/rand) -[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/kas-gui/kas/actions) [![Latest version](https://img.shields.io/crates/v/rand_hc.svg)](https://crates.io/crates/rand_hc) [[![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_hc) diff --git a/rand_pcg/README.md b/rand_pcg/README.md index 97204213c8d..bf2e6085eab 100644 --- a/rand_pcg/README.md +++ b/rand_pcg/README.md @@ -1,7 +1,6 @@ # rand_pcg -[![Build Status](https://travis-ci.org/rust-random/rand.svg?branch=master)](https://travis-ci.org/rust-random/rand) -[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/kas-gui/kas/actions) [![Latest version](https://img.shields.io/crates/v/rand_pcg.svg)](https://crates.io/crates/rand_pcg) [![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_pcg) From e9d62953e9f7510bc56c77efe75df3affa9f79b7 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Tue, 8 Dec 2020 12:50:16 +0000 Subject: [PATCH 04/20] Migrate tests to GH-Actions Incomplete: Linux 32-bit, Big-Endian, Web --- .github/workflows/test.yml | 99 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 68 -------------------------- appveyor.yml | 48 ------------------ utils/ci/miri.sh | 18 ------- 4 files changed, 99 insertions(+), 134 deletions(-) delete mode 100644 appveyor.yml delete mode 100644 utils/ci/miri.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b1b51c22d89..85d03cce039 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/.travis.yml b/.travis.yml index 82093929ca7..5c0b6a03638 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 @@ -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 diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index c7d35ef2b33..00000000000 --- a/appveyor.yml +++ /dev/null @@ -1,48 +0,0 @@ -environment: - - # At the time this was added AppVeyor was having troubles with checking - # revocation of SSL certificates of sites like static.rust-lang.org and what - # we think is crates.io. The libcurl HTTP client by default checks for - # revocation on Windows and according to a mailing list [1] this can be - # disabled. - # - # The `CARGO_HTTP_CHECK_REVOKE` env var here tells cargo to disable SSL - # revocation checking on Windows in libcurl. Note, though, that rustup, which - # we're using to download Rust here, also uses libcurl as the default backend. - # Unlike Cargo, however, rustup doesn't have a mechanism to disable revocation - # checking. To get rustup working we set `RUSTUP_USE_HYPER` which forces it to - # use the Hyper instead of libcurl backend. Both Hyper and libcurl use - # schannel on Windows but it appears that Hyper configures it slightly - # differently such that revocation checking isn't turned on by default. - # - # [1]: https://curl.haxx.se/mail/lib-2016-03/0202.html - RUSTUP_USE_HYPER: 1 - CARGO_HTTP_CHECK_REVOKE: false - - matrix: - - TARGET: x86_64-pc-windows-msvc - - TARGET: i686-pc-windows-msvc -install: - - appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe - - rustup-init.exe -y --default-host %TARGET% --default-toolchain nightly - - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin - - rustc -V - - cargo -V - -build: false - -test_script: - - cargo test --tests --no-default-features - - cargo test --tests --no-default-features --features=alloc,getrandom - - cargo test --features simd_support - # all stable features: - - cargo test --features=serde1,log - - cargo test --benches --features=nightly - - cargo test --examples - - 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 - - cargo test --manifest-path rand_distr/Cargo.toml - - cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1 - - cargo test --manifest-path rand_chacha/Cargo.toml - - cargo test --manifest-path rand_hc/Cargo.toml diff --git a/utils/ci/miri.sh b/utils/ci/miri.sh deleted file mode 100644 index 7e06091ff32..00000000000 --- a/utils/ci/miri.sh +++ /dev/null @@ -1,18 +0,0 @@ -set -ex - -MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri) -echo "Installing latest nightly with Miri: $MIRI_NIGHTLY" -rustup default "$MIRI_NIGHTLY" - -rustup component add miri -cargo miri setup - -cargo miri test --no-default-features -cargo miri test --features=log -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 From cc5726afb8fde7a8d8e0f748257f11249a18cb59 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Tue, 8 Dec 2020 12:54:25 +0000 Subject: [PATCH 05/20] Fix YAML syntax --- .github/workflows/test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 85d03cce039..8fa83c4979c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,8 @@ jobs: override: true run: cargo install cargo-deadlinks - name: doc (rand) - env: RUSTDOCFLAGS: --cfg doc_cfg + 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 @@ -47,10 +48,10 @@ jobs: toolchain: ${{ matrix.toolchain }} override: true - name: Maybe minimal - if ${{ matrix.minimal }} + if: ${{ matrix.minimal }} run: cargo generate-lockfile -Z minimal-versions - name: Maybe nightly - if ${{ matrix.toolchain == 'nightly' }} + if: ${{ matrix.toolchain == 'nightly' }} run: | cargo test --tests --features=nightly cargo test --all-features From ceb0b6b5f9884ef5d7c82f4e409e44f0669179a0 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Tue, 8 Dec 2020 15:46:48 +0000 Subject: [PATCH 06/20] Fix: avoid uses and runs in same step --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8fa83c4979c..7dcce1c1f3c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: profile: minimal toolchain: nightly override: true - run: cargo install cargo-deadlinks + - run: cargo install cargo-deadlinks - name: doc (rand) env: RUSTDOCFLAGS: --cfg doc_cfg From 9913c6562b81206413680130cce62c1f3a83060a Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Tue, 8 Dec 2020 15:54:06 +0000 Subject: [PATCH 07/20] More fixes --- .github/workflows/gh-pages.yml | 3 ++- .github/workflows/test.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 7e8a69a34ef..ad9b0943d4f 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -18,7 +18,8 @@ jobs: toolchain: nightly override: true - name: doc (rand) - env: RUSTDOCFLAGS: --cfg doc_cfg + env: + RUSTDOCFLAGS: --cfg doc_cfg # --all builds all crates, but with default features for other crates (okay in this case) run: cargo doc --all --features nightly,serde1,getrandom,small_rng - name: Deploy diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7dcce1c1f3c..e38e77d766c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -111,7 +111,7 @@ jobs: - name: Build top-level only run: cargo build --target=thumbv6m-none-eabi --no-default-features - test-no-std: + test-ios: runs-on: macos-latest steps: - uses: actions/checkout@v2 From e625a43f510f2f32b95a2156d7ef45af07d8cba7 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Tue, 8 Dec 2020 15:56:45 +0000 Subject: [PATCH 08/20] fix --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e38e77d766c..2615c3f20ce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,10 +31,9 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - toolchain: [] + toolchain: [stable] minimal: [false] include: - - toolchain: [stable] - os: ubuntu-latest toolchain: [beta, 1.36.0, nightly] - os: ubuntu-latest From 6917df89ff5b17ad8860acd58678818b2ff40950 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Tue, 8 Dec 2020 16:00:34 +0000 Subject: [PATCH 09/20] fix --- .github/workflows/test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2615c3f20ce..a5f5a825ac5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,7 +35,11 @@ jobs: minimal: [false] include: - os: ubuntu-latest - toolchain: [beta, 1.36.0, nightly] + toolchain: beta + - os: ubuntu-latest + toolchain: 1.36.0 + - os: ubuntu-latest + toolchain: nightly - os: ubuntu-latest minimal: true @@ -85,6 +89,7 @@ jobs: run: | MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri) rustup default "$MIRI_NIGHTLY" + rustup component add miri - name: Test rand run: | cargo miri test --no-default-features From b06c77ff535c6c02fc564ea71c362b8348bd42bd Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Tue, 8 Dec 2020 16:02:58 +0000 Subject: [PATCH 10/20] fix --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a5f5a825ac5..7f5bfc7d0fa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,6 +41,7 @@ jobs: - os: ubuntu-latest toolchain: nightly - os: ubuntu-latest + toolchain: nightly minimal: true steps: From 8e77916782c86f360f0149061e71b33c597ff6f5 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Thu, 10 Dec 2020 11:40:30 +0000 Subject: [PATCH 11/20] Fix link URL --- README.md | 2 +- rand_chacha/README.md | 2 +- rand_core/README.md | 2 +- rand_distr/README.md | 2 +- rand_hc/README.md | 2 +- rand_pcg/README.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6db4cce8a52..3ca09b008b7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Rand -[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/kas-gui/kas/actions) +[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/rust-random/rand/actions) [![Crate](https://img.shields.io/crates/v/rand.svg)](https://crates.io/crates/rand) [![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand) diff --git a/rand_chacha/README.md b/rand_chacha/README.md index 9d5a2198a29..edd754d791e 100644 --- a/rand_chacha/README.md +++ b/rand_chacha/README.md @@ -1,6 +1,6 @@ # rand_chacha -[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/kas-gui/kas/actions) +[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/rust-random/rand/actions) [![Latest version](https://img.shields.io/crates/v/rand_chacha.svg)](https://crates.io/crates/rand_chacha) [![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_chacha) diff --git a/rand_core/README.md b/rand_core/README.md index 151fcd425a8..aaec728672c 100644 --- a/rand_core/README.md +++ b/rand_core/README.md @@ -1,6 +1,6 @@ # rand_core -[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/kas-gui/kas/actions) +[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/rust-random/rand/actions) [![Latest version](https://img.shields.io/crates/v/rand_core.svg)](https://crates.io/crates/rand_core) [![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_core) diff --git a/rand_distr/README.md b/rand_distr/README.md index 142ffa9ba30..29b5fe0853e 100644 --- a/rand_distr/README.md +++ b/rand_distr/README.md @@ -1,6 +1,6 @@ # rand_distr -[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/kas-gui/kas/actions) +[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/rust-random/rand/actions) [![Latest version](https://img.shields.io/crates/v/rand_distr.svg)](https://crates.io/crates/rand_distr) [[![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_distr) diff --git a/rand_hc/README.md b/rand_hc/README.md index 34cfa9610ac..87f1c8915c1 100644 --- a/rand_hc/README.md +++ b/rand_hc/README.md @@ -1,6 +1,6 @@ # rand_hc -[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/kas-gui/kas/actions) +[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/rust-random/rand/actions) [![Latest version](https://img.shields.io/crates/v/rand_hc.svg)](https://crates.io/crates/rand_hc) [[![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_hc) diff --git a/rand_pcg/README.md b/rand_pcg/README.md index bf2e6085eab..736a789035c 100644 --- a/rand_pcg/README.md +++ b/rand_pcg/README.md @@ -1,6 +1,6 @@ # rand_pcg -[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/kas-gui/kas/actions) +[![Test Status](https://github.com/rust-random/rand/workflows/Tests/badge.svg?event=push)](https://github.com/rust-random/rand/actions) [![Latest version](https://img.shields.io/crates/v/rand_pcg.svg)](https://crates.io/crates/rand_pcg) [![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_pcg) From dadf0ea4fd0add80f2077e0315fe3886585b33ff Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Thu, 10 Dec 2020 12:04:07 +0000 Subject: [PATCH 12/20] CI: add explicit target selections --- .github/workflows/test.yml | 54 ++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f5bfc7d0fa..944ad43b544 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,17 +30,30 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - toolchain: [stable] minimal: [false] include: - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + toolchain: stable + - os: macos-latest + target: x86_64-apple-darwin + toolchain: stable + # TODO: also aarch64 / M1 + - os: windows-latest + target: x86_64-pc-windows-gnu + toolchain: stable + - os: windows-latest + target: x86_64-pc-windows-msvc toolchain: beta + # Test both windows-gnu and windows-msvc; use beta rust on one - os: ubuntu-latest - toolchain: 1.36.0 + target: x86_64-unknown-linux-gnu + toolchain: 1.36.0 # MSRV - os: ubuntu-latest + target: i686-unknown-linux-gnu toolchain: nightly - os: ubuntu-latest + target: x86_64-unknown-linux-gnu toolchain: nightly minimal: true @@ -49,38 +62,39 @@ jobs: - name: Install toolchain uses: actions-rs/toolchain@v1 with: - toolchain: ${{ matrix.toolchain }} - override: true + target: ${{ matrix.target }} + 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 + cargo test --target $${ matrix.target }} --tests --features=nightly + cargo test --target $${ matrix.target }} --all-features + cargo test --target $${ matrix.target }} --benches --features=nightly + cargo test --target $${ matrix.target }} --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 + cargo test --target $${ matrix.target }} --tests --no-default-features + cargo test --target $${ matrix.target }} --tests --no-default-features --features=alloc,getrandom,small_rng # all stable features: - cargo test --features=serde1,log,small_rng - cargo test --examples + cargo test --target $${ matrix.target }} --features=serde1,log,small_rng + cargo test --target $${ matrix.target }} --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 + cargo test --target $${ matrix.target }} --manifest-path rand_core/Cargo.toml + cargo test --target $${ matrix.target }} --manifest-path rand_core/Cargo.toml --no-default-features + cargo test --target $${ matrix.target }} --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 + run: cargo test --target $${ matrix.target }} --manifest-path rand_distr/Cargo.toml - name: Test rand_pcg - run: cargo test --manifest-path rand_pcg/Cargo.toml --features=serde1 + run: cargo test --target $${ matrix.target }} --manifest-path rand_pcg/Cargo.toml --features=serde1 - name: Test rand_chacha - run: cargo test --manifest-path rand_chacha/Cargo.toml + run: cargo test --target $${ matrix.target }} --manifest-path rand_chacha/Cargo.toml - name: Test rand_hc - run: cargo test --manifest-path rand_hc/Cargo.toml + run: cargo test --target $${ matrix.target }} --manifest-path rand_hc/Cargo.toml test-miri: runs-on: ubuntu-latest From 95970aa8b36b6434c75bfb30591a407a7b7feaa0 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Thu, 10 Dec 2020 12:05:31 +0000 Subject: [PATCH 13/20] Remove rest of old config --- .travis.yml | 24 -------------- utils/ci/install.sh | 49 ----------------------------- utils/ci/install_cargo_web.sh | 15 --------- utils/ci/script.sh | 59 ----------------------------------- 4 files changed, 147 deletions(-) delete mode 100644 .travis.yml delete mode 100644 utils/ci/install.sh delete mode 100755 utils/ci/install_cargo_web.sh delete mode 100644 utils/ci/script.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5c0b6a03638..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: rust -sudo: false - -# Since most OS-specific code has moved to the getrandom crate, we require -# few target-specific tests here. - -matrix: - include: - # This target catches endianness issues - - rust: stable - sudo: required - dist: trusty - services: docker - name: "Linux (MIPS, big-endian)" - env: TARGET=mips-unknown-linux-gnu - install: - - sh utils/ci/install.sh - - source ~/.cargo/env || true - - - rust: nightly - name: "Linux, nightly (32-bit test)" - env: TARGET=i686-unknown-linux-musl - install: - - rustup target add $TARGET diff --git a/utils/ci/install.sh b/utils/ci/install.sh deleted file mode 100644 index 8e636e18175..00000000000 --- a/utils/ci/install.sh +++ /dev/null @@ -1,49 +0,0 @@ -# From https://github.com/japaric/trust - -set -ex - -main() { - local target= - if [ $TRAVIS_OS_NAME = linux ]; then - target=x86_64-unknown-linux-musl - sort=sort - else - target=x86_64-apple-darwin - sort=gsort # for `sort --sort-version`, from brew's coreutils. - fi - - # Builds for iOS are done on OSX, but require the specific target to be - # installed. - case $TARGET in - aarch64-apple-ios) - rustup target install aarch64-apple-ios - ;; - armv7-apple-ios) - rustup target install armv7-apple-ios - ;; - armv7s-apple-ios) - rustup target install armv7s-apple-ios - ;; - i386-apple-ios) - rustup target install i386-apple-ios - ;; - x86_64-apple-ios) - rustup target install x86_64-apple-ios - ;; - esac - - # This fetches latest stable release - local tag=$(git ls-remote --tags --refs --exit-code https://github.com/japaric/cross \ - | cut -d/ -f3 \ - | grep -E '^v[0.1.0-9.]+$' \ - | $sort --version-sort \ - | tail -n1) - curl -LSfs https://japaric.github.io/trust/install.sh | \ - sh -s -- \ - --force \ - --git japaric/cross \ - --tag $tag \ - --target $target -} - -main diff --git a/utils/ci/install_cargo_web.sh b/utils/ci/install_cargo_web.sh deleted file mode 100755 index b35f0691984..00000000000 --- a/utils/ci/install_cargo_web.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -euo pipefail -IFS=$'\n\t' - -CARGO_WEB_RELEASE=$(curl -L -s -H 'Accept: application/json' https://github.com/koute/cargo-web/releases/latest) -CARGO_WEB_VERSION=$(echo $CARGO_WEB_RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/') -CARGO_WEB_URL="https://github.com/koute/cargo-web/releases/download/$CARGO_WEB_VERSION/cargo-web-x86_64-unknown-linux-gnu.gz" - -echo "Downloading cargo-web from: $CARGO_WEB_URL" -curl -L $CARGO_WEB_URL | gzip -d > cargo-web -chmod +x cargo-web - -mkdir -p ~/.cargo/bin -mv cargo-web ~/.cargo/bin diff --git a/utils/ci/script.sh b/utils/ci/script.sh deleted file mode 100644 index caef0767ca9..00000000000 --- a/utils/ci/script.sh +++ /dev/null @@ -1,59 +0,0 @@ -# Derived from https://github.com/japaric/trust - -set -ex - -# ----- Options ----- - -# TARGET enables cross-building -if [ -z $TARGET ]; then - CARGO=cargo -elif [ "$TARGET" = "i686-unknown-linux-musl" ]; then - CARGO=cargo - TARGET="--target $TARGET" -else - CARGO=cross - TARGET="--target $TARGET" -fi - -# ALLOC defaults on; is disabled for rustc < 1.36 -if [ -z $ALLOC ]; then - ALLOC=1 -fi - -# NIGHTLY defaults off - - -# ----- Script ----- - -main() { - if [ "0$NIGHTLY" -ge 1 ]; then - $CARGO test $TARGET --all-features - $CARGO test $TARGET --benches --features=nightly - $CARGO test $TARGET --manifest-path rand_distr/Cargo.toml --benches - else - # all stable features: - $CARGO test $TARGET --features=serde1,log,small_rng - fi - - if [ "$ALLOC" -ge 1 ]; then - $CARGO test $TARGET --tests --no-default-features --features=alloc,getrandom,small_rng - $CARGO test $TARGET --manifest-path rand_core/Cargo.toml --no-default-features --features=alloc - fi - - $CARGO test $TARGET --tests --no-default-features - $CARGO test $TARGET --examples - - $CARGO test $TARGET --manifest-path rand_core/Cargo.toml - $CARGO test $TARGET --manifest-path rand_core/Cargo.toml --no-default-features - $CARGO test $TARGET --manifest-path rand_core/Cargo.toml --no-default-features --features=getrandom - - $CARGO test $TARGET --manifest-path rand_distr/Cargo.toml - $CARGO test $TARGET --manifest-path rand_pcg/Cargo.toml --features=serde1 - $CARGO test $TARGET --manifest-path rand_chacha/Cargo.toml - $CARGO test $TARGET --manifest-path rand_hc/Cargo.toml -} - -# we don't run the "test phase" when doing deploys -if [ -z $TRAVIS_TAG ]; then - main -fi From a0b94cb6625e00593365cd73b59e802f61252ede Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Thu, 10 Dec 2020 12:07:38 +0000 Subject: [PATCH 14/20] Fix syntax --- .github/workflows/test.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 944ad43b544..f8defa92d51 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -71,30 +71,30 @@ jobs: - name: Maybe nightly if: ${{ matrix.toolchain == 'nightly' }} run: | - cargo test --target $${ matrix.target }} --tests --features=nightly - cargo test --target $${ matrix.target }} --all-features - cargo test --target $${ matrix.target }} --benches --features=nightly - cargo test --target $${ matrix.target }} --manifest-path rand_distr/Cargo.toml --benches + cargo test --target ${{ matrix.target }} --tests --features=nightly + cargo test --target ${{ matrix.target }} --all-features + cargo test --target ${{ matrix.target }} --benches --features=nightly + cargo test --target ${{ matrix.target }} --manifest-path rand_distr/Cargo.toml --benches - name: Test rand run: | - cargo test --target $${ matrix.target }} --tests --no-default-features - cargo test --target $${ matrix.target }} --tests --no-default-features --features=alloc,getrandom,small_rng + cargo test --target ${{ matrix.target }} --tests --no-default-features + cargo test --target ${{ matrix.target }} --tests --no-default-features --features=alloc,getrandom,small_rng # all stable features: - cargo test --target $${ matrix.target }} --features=serde1,log,small_rng - cargo test --target $${ matrix.target }} --examples + cargo test --target ${{ matrix.target }} --features=serde1,log,small_rng + cargo test --target ${{ matrix.target }} --examples - name: Test rand_core run: | - cargo test --target $${ matrix.target }} --manifest-path rand_core/Cargo.toml - cargo test --target $${ matrix.target }} --manifest-path rand_core/Cargo.toml --no-default-features - cargo test --target $${ matrix.target }} --manifest-path rand_core/Cargo.toml --no-default-features --features=alloc,getrandom + cargo test --target ${{ matrix.target }} --manifest-path rand_core/Cargo.toml + cargo test --target ${{ matrix.target }} --manifest-path rand_core/Cargo.toml --no-default-features + cargo test --target ${{ matrix.target }} --manifest-path rand_core/Cargo.toml --no-default-features --features=alloc,getrandom - name: Test rand_distr - run: cargo test --target $${ matrix.target }} --manifest-path rand_distr/Cargo.toml + run: cargo test --target ${{ matrix.target }} --manifest-path rand_distr/Cargo.toml - name: Test rand_pcg - run: cargo test --target $${ matrix.target }} --manifest-path rand_pcg/Cargo.toml --features=serde1 + run: cargo test --target ${{ matrix.target }} --manifest-path rand_pcg/Cargo.toml --features=serde1 - name: Test rand_chacha - run: cargo test --target $${ matrix.target }} --manifest-path rand_chacha/Cargo.toml + run: cargo test --target ${{ matrix.target }} --manifest-path rand_chacha/Cargo.toml - name: Test rand_hc - run: cargo test --target $${ matrix.target }} --manifest-path rand_hc/Cargo.toml + run: cargo test --target ${{ matrix.target }} --manifest-path rand_hc/Cargo.toml test-miri: runs-on: ubuntu-latest From ec0bf6003a7a0858531893794f03d5611b371353 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Thu, 10 Dec 2020 12:15:52 +0000 Subject: [PATCH 15/20] i686 linux: install gcc-multilib --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f8defa92d51..c672b955a1e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,6 +50,7 @@ jobs: target: x86_64-unknown-linux-gnu toolchain: 1.36.0 # MSRV - os: ubuntu-latest + deps: sudo apt install gcc-multilib target: i686-unknown-linux-gnu toolchain: nightly - os: ubuntu-latest @@ -65,6 +66,7 @@ jobs: target: ${{ matrix.target }} toolchain: ${{ matrix.toolchain }} override: true + - run: ${{ matrix.deps }} - name: Maybe minimal if: ${{ matrix.minimal }} run: cargo generate-lockfile -Z minimal-versions From a08fc541ffceb63a64c950c5ce205bd7f31ada90 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Thu, 10 Dec 2020 12:30:57 +0000 Subject: [PATCH 16/20] Lower required precision for Cauchy stability test --- rand_distr/src/cauchy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rand_distr/src/cauchy.rs b/rand_distr/src/cauchy.rs index ffe86d00a9b..1fadf0c6f61 100644 --- a/rand_distr/src/cauchy.rs +++ b/rand_distr/src/cauchy.rs @@ -160,7 +160,7 @@ mod test { let expected = [15.023088, -5.446413, 3.7092876, 3.112482]; for (a, b) in buf.iter().zip(expected.iter()) { let (a, b) = (*a, *b); - assert!((a - b).abs() < 1e-6, "expected: {} = {}", a, b); + assert!((a - b).abs() < 1e-5, "expected: {} = {}", a, b); } } } From b09fd63b2e87a2f503b9ca9743519bc3830931f6 Mon Sep 17 00:00:00 2001 From: Diggory Hardy Date: Thu, 10 Dec 2020 12:32:26 +0000 Subject: [PATCH 17/20] Adjust test matrix --- .github/workflows/test.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c672b955a1e..b7ff5821cbd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,32 +30,25 @@ jobs: strategy: fail-fast: false matrix: + os: [ubuntu-latest] + target: [x86_64-unknown-linux-gnu] + toolchain: [stable] minimal: [false] include: - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - toolchain: stable - os: macos-latest target: x86_64-apple-darwin - toolchain: stable # TODO: also aarch64 / M1 - os: windows-latest target: x86_64-pc-windows-gnu - toolchain: stable - os: windows-latest target: x86_64-pc-windows-msvc toolchain: beta # Test both windows-gnu and windows-msvc; use beta rust on one - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - toolchain: 1.36.0 # MSRV - - os: ubuntu-latest - deps: sudo apt install gcc-multilib + - toolchain: 1.36.0 # MSRV + - deps: sudo apt install gcc-multilib target: i686-unknown-linux-gnu toolchain: nightly - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - toolchain: nightly + - toolchain: nightly minimal: true steps: From 8126ed56df9cefb01f16c3e5a34588f146bb6f1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Thu, 10 Dec 2020 12:44:45 +0000 Subject: [PATCH 18/20] GA test --- .github/workflows/test.yml | 103 ++----------------------------------- 1 file changed, 4 insertions(+), 99 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b7ff5821cbd..84fbb5e5d61 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,27 +30,8 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] - target: [x86_64-unknown-linux-gnu] - toolchain: [stable] - minimal: [false] - include: - - os: macos-latest - target: x86_64-apple-darwin - # TODO: also aarch64 / M1 - - os: windows-latest - target: x86_64-pc-windows-gnu - - os: windows-latest - target: x86_64-pc-windows-msvc - toolchain: beta - # Test both windows-gnu and windows-msvc; use beta rust on one - - toolchain: 1.36.0 # MSRV - - deps: sudo apt install gcc-multilib - target: i686-unknown-linux-gnu - toolchain: nightly - - toolchain: nightly - minimal: true - + os: [ubuntu-latest, macos-latest, ] + toolchain: [stable, nightly] steps: - uses: actions/checkout@v2 - name: Install toolchain @@ -59,81 +40,5 @@ jobs: target: ${{ matrix.target }} toolchain: ${{ matrix.toolchain }} override: true - - run: ${{ matrix.deps }} - - name: Maybe minimal - if: ${{ matrix.minimal }} - run: cargo generate-lockfile -Z minimal-versions - - name: Maybe nightly - if: ${{ matrix.toolchain == 'nightly' }} - run: | - cargo test --target ${{ matrix.target }} --tests --features=nightly - cargo test --target ${{ matrix.target }} --all-features - cargo test --target ${{ matrix.target }} --benches --features=nightly - cargo test --target ${{ matrix.target }} --manifest-path rand_distr/Cargo.toml --benches - - name: Test rand - run: | - cargo test --target ${{ matrix.target }} --tests --no-default-features - cargo test --target ${{ matrix.target }} --tests --no-default-features --features=alloc,getrandom,small_rng - # all stable features: - cargo test --target ${{ matrix.target }} --features=serde1,log,small_rng - cargo test --target ${{ matrix.target }} --examples - - name: Test rand_core - run: | - cargo test --target ${{ matrix.target }} --manifest-path rand_core/Cargo.toml - cargo test --target ${{ matrix.target }} --manifest-path rand_core/Cargo.toml --no-default-features - cargo test --target ${{ matrix.target }} --manifest-path rand_core/Cargo.toml --no-default-features --features=alloc,getrandom - - name: Test rand_distr - run: cargo test --target ${{ matrix.target }} --manifest-path rand_distr/Cargo.toml - - name: Test rand_pcg - run: cargo test --target ${{ matrix.target }} --manifest-path rand_pcg/Cargo.toml --features=serde1 - - name: Test rand_chacha - run: cargo test --target ${{ matrix.target }} --manifest-path rand_chacha/Cargo.toml - - name: Test rand_hc - run: cargo test --target ${{ matrix.target }} --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" - rustup component add miri - - 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-ios: - 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 + - run: cargo test + - run: cargo test --target ${{ matrix.target }} --all-features From d647f50afb025aa3bf959239d0caef727cba72ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Thu, 10 Dec 2020 12:47:35 +0000 Subject: [PATCH 19/20] add windows --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84fbb5e5d61..46b5b10d9cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, ] + os: [ubuntu-latest, macos-latest, windows-latest] toolchain: [stable, nightly] steps: - uses: actions/checkout@v2 From 0cba53e6414ad6e9405440fbfab2bb65cc19878a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Thu, 10 Dec 2020 12:49:57 +0000 Subject: [PATCH 20/20] remove target --- .github/workflows/test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 46b5b10d9cc..b130cde75a0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,8 +37,7 @@ jobs: - name: Install toolchain uses: actions-rs/toolchain@v1 with: - target: ${{ matrix.target }} toolchain: ${{ matrix.toolchain }} override: true - run: cargo test - - run: cargo test --target ${{ matrix.target }} --all-features + - run: cargo test --all-features