Skip to content

Commit

Permalink
Merge #40
Browse files Browse the repository at this point in the history
40: Cleanup CI config r=taiki-e a=taiki-e



Co-authored-by: Taiki Endo <[email protected]>
  • Loading branch information
bors[bot] and taiki-e authored Apr 22, 2020
2 parents dfa7654 + a4b90d8 commit f627916
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 21 deletions.
8 changes: 1 addition & 7 deletions .github/bors.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
status = [
"test (nightly-2020-02-14)",
"test (nightly)",
"style (clippy)",
"style (rustfmt)",
"style (rustdoc)",
]
status = ["ci"]
delete_merged_branches = true
32 changes: 29 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: CI

on:
pull_request:
Expand All @@ -12,11 +12,11 @@ on:

env:
RUSTFLAGS: -Dwarnings
RUST_BACKTRACE: 1

jobs:
test:
name: test
runs-on: ubuntu-latest
strategy:
matrix:
rust:
Expand All @@ -25,6 +25,7 @@ jobs:
# Rust version in README.md.
- nightly-2020-02-14
- nightly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
Expand Down Expand Up @@ -60,14 +61,14 @@ jobs:
style:
name: style
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
component:
- clippy
- rustfmt
- rustdoc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Rust
Expand All @@ -94,3 +95,28 @@ jobs:
RUSTDOCFLAGS: -Dwarnings -Aunused_braces
run: |
cargo doc --no-deps --all --all-features
# Refs: https://github.com/rust-lang/crater/blob/9ab6f9697c901c4a44025cf0a39b73ad5b37d198/.github/workflows/bors.yml#L125-L149
#
# ALL THE PREVIOUS JOBS NEEDS TO BE ADDED TO THE `needs` SECTION OF THIS JOB!

ci-success:
name: ci
if: github.event_name == 'push' && success()
needs:
- style
- test
runs-on: ubuntu-latest
steps:
- name: Mark the job as a success
run: exit 0
ci-failure:
name: ci
if: github.event_name == 'push' && !success()
needs:
- style
- test
runs-on: ubuntu-latest
steps:
- name: Mark the job as a failure
run: exit 1
14 changes: 4 additions & 10 deletions ci/install-component.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,13 @@ if ! rustup component add "${component}" 2>/dev/null; then
target=$(curl -sSf "https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/${component}")
echo "'${component}' is unavailable on the default toolchain, use the toolchain 'nightly-${target}' instead"

rustup update "nightly-${target}" --no-self-update
rustup default "nightly-${target}"

echo "Query rust and cargo versions:"
rustup -V
rustc -V
cargo -V
# shellcheck disable=SC1091
. ci/scripts/install-rust.sh "nightly-${target}"

rustup component add "${component}"
fi

echo "Query component versions:"
case "${component}" in
clippy | miri) cargo "${component}" -V ;;
rustfmt) "${component}" -V ;;
rustfmt | rustdoc) "${component}" -V ;;
*) cargo "${component}" -V ;;
esac
1 change: 0 additions & 1 deletion ci/install-rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ else
echo "##[add-path]${HOME}/.cargo/bin"
fi

echo "Query rust and cargo versions:"
rustup -V
rustc -V
cargo -V

0 comments on commit f627916

Please sign in to comment.