Skip to content

Commit

Permalink
[ci]: github actions (#179)
Browse files Browse the repository at this point in the history
* docs(http client): tokio 0.2 -> tokio 1.0

* [ci]: remove travis

* [ci]: add github actions.

* [ci]: fix identation nits

* [ci]: use cache for actions

* [ci]: filter to clippy

* [ci]: remove hacks

* separate action for ci and benchmarks
  • Loading branch information
niklasad1 authored Jan 12, 2021
1 parent abe0d98 commit 7a0dcaf
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 20 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
target-branch: "v2"
schedule:
interval: "daily"

- package-ecosystem: "github-actions"
directory: "/"
target-branch: "v2"
schedule:
interval: "daily"
40 changes: 40 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Benchmarks

on:
schedule:
- cron: "0 0 * * *"

jobs:
bench:
name: Run benchmarks daily
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v2

- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Cache Dependencies & Build Outputs
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
tool: 'cargo'
output-file-path: output.txt
fail-on-alert: true
github-token: ${{ secrets.GITHUB_TOKEN }}
comment-on-alert: true
alert-comment-cc-users: '@niklasad1, @maciejhirsz'
auto-push: true
111 changes: 111 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Continuous integration

on:
pull_request:
push:
branches:
- v2

jobs:
check-style:
name: Check style
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- name: Cache Dependencies & Build Outputs
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -A clippy::mutable_key_type

check-code:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Cache Dependencies & Build Outputs
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Cargo check no-default-features
uses: actions-rs/cargo@v1
with:
command: check
args: --benches --tests

- name: Cargo check all-features
uses: actions-rs/cargo@v1
with:
command: check
args: --benches --tests --all-features

tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Cache Dependencies & Build Outputs
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --workspace

- name: Cargo test
uses: actions-rs/cargo@v1
with:
command: test
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

0 comments on commit 7a0dcaf

Please sign in to comment.