Skip to content

Commit

Permalink
Merge pull request #180 from mgeisler/simplify-ci
Browse files Browse the repository at this point in the history
Simplify CI, drop Rust 1.31 compatibility
  • Loading branch information
mgeisler committed Apr 19, 2020
2 parents a2d6e9c + 6d67772 commit d0ca2e8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 51 deletions.
14 changes: 3 additions & 11 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,13 @@ environment:
- TOOLCHAIN: stable
- TOOLCHAIN: nightly

matrix:
allow_failures:
- TOOLCHAIN: nightly

install:
- ps: Start-FileDownload 'https://static.rust-lang.org/rustup/dist/i686-pc-windows-gnu/rustup-init.exe'
- rustup-init.exe -y --default-toolchain %TOOLCHAIN%
- rustup-init.exe -y --profile minimal --default-toolchain %TOOLCHAIN%
- set PATH=%PATH%;%USERPROFILE%\.cargo\bin

build_script:
- cargo build --verbose --all-features
- cargo build --all-features

test_script:
- cargo test --verbose --all-features

cache:
- '%USERPROFILE%\.cargo'
- target
- cargo test --all-features
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ language: rust
rust:
- stable
- nightly
- 1.31.0 # Rust 2018

cache: cargo
install:
- cargo build --all-features

script:
- cargo build --verbose --all-features
- cargo test --verbose --all-features
- cargo test --all-features
- if [[ $TRAVIS_RUST_VERSION == "nightly" ]]; then cargo build --benches; fi
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ lipsum = "0.6"
rand = "0.6"
rand_xorshift = "0.1"
version-sync = "0.8"
yaml-rust = "0.4"
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
[![](https://codecov.io/gh/mgeisler/textwrap/branch/master/graph/badge.svg)][codecov]
[![](https://img.shields.io/crates/v/textwrap.svg)][crates-io]
[![](https://docs.rs/textwrap/badge.svg)][api-docs]
[![](https://img.shields.io/badge/rustc-1.31.0-4d76ae.svg)][rust-1.31]

Textwrap is a small Rust crate for word wrapping text. You can use it
to format strings for display in commandline applications. The crate
Expand Down Expand Up @@ -185,8 +184,16 @@ This section lists the largest changes per release.

### Unreleased ###

We now require the [Rust 2018 edition][rust-1.31]. This will be a
stable baseline going forward.
We now require the [Rust 2018 edition][rust-2018]. Over the years,
we’ve repeatedly seen build failures in our CI, even when nothing
changed in `textwrap`. The failures happened because we tested against
a fixed version of Rust, but our dependencies kept releasing new patch
it has versions that would push up the minimum required Rust version.

The build failures makes it infeasible to keep `textwrap` compatible
with any particular version of Rust. We will therefore track the
latest stable version of Rust from now on.


### Version 0.11.0 — December 9th, 2018

Expand Down Expand Up @@ -321,7 +328,7 @@ Contributions will be accepted under the same license.
[py-textwrap]: https://docs.python.org/library/textwrap
[patterns]: https://github.com/tapeinosyne/hyphenation/tree/master/patterns-tex
[api-docs]: https://docs.rs/textwrap/
[rust-1.31]: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1310-2018-12-06
[rust-2018]: https://doc.rust-lang.org/edition-guide/rust-2018/
[issue-13]: https://github.com/mgeisler/textwrap/issues/13
[issue-14]: https://github.com/mgeisler/textwrap/issues/14
[issue-19]: https://github.com/mgeisler/textwrap/issues/19
Expand Down
31 changes: 0 additions & 31 deletions tests/version-numbers.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
use std::fs::File;
use std::io::Read;
use yaml_rust::YamlLoader;

#[test]
fn test_readme_deps() {
version_sync::assert_markdown_deps_updated!("README.md");
Expand All @@ -15,33 +11,6 @@ fn test_readme_changelog() {
);
}

#[test]
fn test_readme_rustc_min_version() {
let mut file = File::open(".travis.yml").expect("Could not open");
let mut buf = String::new();
file.read_to_string(&mut buf).expect("Could not read");

let yaml = YamlLoader::load_from_str(&buf).expect("Could not parse");
assert_eq!(yaml.len(), 1, "Expected a single YAML document");

let rust_versions = &yaml[0]["rust"]
.as_vec()
.expect("Could not find vector with Rust versions");

let min_rust_version = rust_versions
.iter()
.filter_map(|version| match version.as_str() {
Some("stable") | Some("beta") | Some("nightly") => None,
version => version,
})
.last()
.expect("No minimum Rust version found");

let pattern = "https://img.shields.io/badge/rustc-{version}-4d76ae.svg";
version_sync::check_contains_regex("README.md", pattern, "", min_rust_version)
.expect("Minimum Rust version not found");
}

#[test]
fn test_html_root_url() {
version_sync::assert_html_root_url_updated!("src/lib.rs");
Expand Down

0 comments on commit d0ca2e8

Please sign in to comment.