Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add matrix CI using Github Actions #353

Merged
merged 17 commits into from
Dec 6, 2019
60 changes: 60 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: build

on: [push]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [stable, nightly]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about running nightly on all platforms, ubuntu should be enough, also we should allow it to fail


steps:
- uses: hecrj/setup-rust-action@v1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does hecrj/setup-rust-action provide compared to action-rs/toolchain?
also, it would be nice to use cache, see https://github.com/iqlusioninc/crates/blob/develop/.github/workflows/rust.yml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly simplifies the install of the rustc version & components with

with:
  rust-version: stable
  components: clippy

with:
rust-version: ${{ matrix.rust }}
components: rustfmt, clippy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the components here and move clippy to a separate job as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep. Wondering if a separate check task is necessary as clippy does run check (https://stackoverflow.com/questions/57449356/is-cargo-clippy-a-superset-of-cargo-check)

- uses: actions/checkout@master
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose

check:
name: check (ubuntu-latest, stable)
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: stable
- name: Checkout sources
uses: actions/checkout@v1
- name: Cargo Check
run: cargo check

clippy:
name: clippy (ubuntu-latest, stable)
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: stable
components: clippy
- name: Checkout sources
uses: actions/checkout@v1
- name: Cargo Clippy
run: cargo clippy -- -D warnings -A deprecated

fmt:
name: fmt (ubuntu-latest, stable)
runs-on: ubuntu-latest
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: stable
components: rustfmt
- name: Checkout sources
uses: actions/checkout@v1
- name: Check Formatting
run: cargo fmt --all -- --check
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Currently available subcommands:
- [`cargo rm`](#cargo-rm)
- [`cargo upgrade`](#cargo-upgrade)

[![Build Status](https://github.com/killercup/cargo-edit/workflows/build/badge.svg)](https://github.com/killercup/cargo-edit/actions)
[![Build Status](https://travis-ci.org/killercup/cargo-edit.svg?branch=master)](https://travis-ci.org/killercup/cargo-edit)
[![Build status](https://ci.appveyor.com/api/projects/status/m23rnkaxhipb23i9/branch/master?svg=true)](https://ci.appveyor.com/project/killercup/cargo-edit/branch/master)
[![Coverage Status](https://coveralls.io/repos/killercup/cargo-edit/badge.svg?branch=master&service=github)](https://coveralls.io/github/killercup/cargo-edit?branch=master)
Expand Down
7 changes: 6 additions & 1 deletion bors.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
status = [
"build (ubuntu-latest, stable)",
"build (ubuntu-latest, nightly)",
"build (windows-latest, stable)",
"build (windows-latest, nightly)",
"build (macOS-latest, stable)",
"build (macOS-latest, nightly)",
"continuous-integration/travis-ci/push",
"continuous-integration/appveyor/branch",
]
use_squash_merge = true