ci: switch to GitHub Actions and bump MSRV to 1.34.0

This commit is contained in:
Andrew Gallant 2020-01-11 09:54:44 -05:00
parent a04c446468
commit 210869b5e3
5 changed files with 79 additions and 64 deletions

78
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,78 @@
name: ci
on:
pull_request:
push:
branches:
- master
schedule:
- cron: '00 01 * * *'
jobs:
test:
name: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
build:
- pinned
- pinned-win
- stable
- beta
- nightly
- macos
- win-msvc
- win-gnu
include:
- build: pinned
os: ubuntu-18.04
rust: 1.34.0
- build: pinned-win
os: windows-2019
rust: 1.34.0
- build: stable
os: ubuntu-18.04
rust: stable
- build: beta
os: ubuntu-18.04
rust: beta
- build: nightly
os: ubuntu-18.04
rust: nightly
- build: macos
os: macos-latest
rust: stable
- build: win-msvc
os: windows-2019
rust: stable
- build: win-gnu
os: windows-2019
rust: stable-x86_64-gnu
steps:
- name: Checkout repository
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install Rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
- run: cargo build --verbose
- run: cargo doc --verbose
- run: cargo test --verbose
rustfmt:
name: rustfmt
runs-on: ubuntu-18.04
steps:
- name: Checkout repository
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install Rust
uses: hecrj/setup-rust-action@v1
with:
rust-version: stable
- name: Install rustfmt
run: rustup component add rustfmt
- name: Check formatting
run: |
cargo fmt --all -- --check

View File

@ -1,30 +0,0 @@
language: rust
env:
global:
- PROJECT_NAME: termcolor
- RUST_BACKTRACE: full
matrix:
fast_finish: true
include:
- os: osx
rust: nightly
env: TARGET=x86_64-apple-darwin
- os: linux
rust: nightly
env: TARGET=x86_64-unknown-linux-gnu
- os: linux
rust: beta
env: TARGET=x86_64-unknown-linux-gnu
# Minimum Rust supported channel. We enable these to make sure ripgrep
# continues to work on the advertised minimum Rust version.
- os: linux
rust: 1.20.0
env: TARGET=x86_64-unknown-linux-gnu
script: ci/script.sh
branches:
only:
# Pushes and PR to the master branch
- master
notifications:
email:
on_success: never

View File

@ -91,7 +91,7 @@ fn write_green() -> io::Result<()> {
### Minimum Rust version policy
This crate's minimum supported `rustc` version is `1.20.0`.
This crate's minimum supported `rustc` version is `1.34.0`.
The current policy is that the minimum Rust version required to use this crate
can be increased in minor version updates. For example, if `crate 1.0` requires

View File

@ -1,20 +0,0 @@
environment:
matrix:
- TARGET: x86_64-pc-windows-msvc
- TARGET: i686-pc-windows-msvc
- TARGET: i686-pc-windows-gnu
install:
- ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe"
- rust-nightly-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
- SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin
- SET PATH=%PATH%;C:\MinGW\bin
- rustc -V
- cargo -V
build: false
test_script:
- cargo build --verbose
- cargo test --verbose
- cargo test --verbose --manifest-path wincolor/Cargo.toml
branches:
only:
- master

View File

@ -1,13 +0,0 @@
#!/bin/bash
# build, test and generate docs in this phase
set -ex
main() {
cargo build --target "$TARGET" --verbose
cargo test --target "$TARGET" --verbose
cargo test --target "$TARGET" --verbose --manifest-path wincolor/Cargo.toml
}
main