-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate from Travis CI to Github Actions
This commit is based on the Github Actions config in slog-term :)
- Loading branch information
Showing
4 changed files
with
121 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This is the clippy workflow, seperate from the main 'Rust' workflow | ||
# | ||
# This will fail if clippy fails (if we encounter any of its "correctness" lints) | ||
# | ||
# Clippy warnings won't fail the build. They may or may not turn into Github warnings. | ||
# | ||
# TODO: Test clippy with different feature combos? | ||
# TODO: Should we fail on clippy warnings? | ||
on: [push, pull_request] | ||
name: Clippy | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
# has a history of occasional bugs (especially on old versions) | ||
# | ||
# the ci is free so we might as well use it ;) | ||
CARGO_INCREMENTAL: 0 | ||
|
||
|
||
jobs: | ||
clippy: | ||
# Only run on PRs if the source branch is on someone else's repo | ||
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: ${{ matrix.rust }} | ||
override: true | ||
components: clippy | ||
- shell: bash | ||
run: | | ||
cargo clippy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# The file is the workflow for rustfmt | ||
# | ||
# It runs `cargo fmt --check` | ||
# | ||
# It will fail if there are formatting problems. | ||
on: [push, pull_request] | ||
name: rustfmt | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
rustfmt: | ||
# Only run on PRs if the source branch is on someone else's repo | ||
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
rust: | ||
- stable | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: ${{ matrix.rust }} | ||
override: true | ||
components: rustfmt | ||
- shell: bash | ||
run: | | ||
cargo fmt -- --check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# We use `actions-rs` for most of our actions | ||
# | ||
# This file is for the main tests. clippy & rustfmt are seperate workflows | ||
# | ||
# It is mostly copied from slog-rs/term | ||
on: [push, pull_request] | ||
name: Cargo Test | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
# has a history of occasional bugs (especially on old versions) | ||
# | ||
# the ci is free so we might as well use it ;) | ||
CARGO_INCREMENTAL: 0 | ||
|
||
|
||
# Tested versions: | ||
# 1. stable | ||
# 2. nightly | ||
# 3. Minimum Supported Rust Version (MSRV) | ||
|
||
jobs: | ||
test: | ||
# Only run on PRs if the source branch is on someone else's repo | ||
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false # Even if one job fails we still want to see the other ones | ||
matrix: | ||
# 1.39 is MSRV. Keep in sync with Cargo.toml | ||
rust: [1.39, stable, nightly] | ||
# NOTE: Features to test must be specified manually. They are applied to all versions seperately. | ||
# | ||
# This has the advantage of being more flexibile and thorough | ||
# This has the disadvantage of being more vebrose | ||
# | ||
# Specific feature combos can be overriden per-version with 'include' and 'exclude' | ||
features: ["", "kv_unstable"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
override: true | ||
# NOTE: We only run `cargo test`. No need for a seperate `cargo check` | ||
- name: Test | ||
run: | | ||
cargo test --verbose --features "${{ matrix.features }}" | ||
This file was deleted.
Oops, something went wrong.