Skip to content

Commit

Permalink
migrate ci to github actions (actix#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede authored Sep 16, 2020
1 parent e3c6a1e commit d836b04
Show file tree
Hide file tree
Showing 11 changed files with 6,522 additions and 77 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/clippy-fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: lint

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
fmt:
name: rustfmt check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt
override: true

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

clippy:
name: clippy check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: cache cargo artifacts
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
./target/debug
key: cargo-clippy-${{ matrix.version }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-clippy-${{ matrix.version }}-
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: clippy
override: true

- name: clippy
uses: actions-rs/clippy-check@v1
timeout-minutes: 30
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --all-features --tests
60 changes: 60 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI (Linux)

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- master

jobs:
build_and_test:
name: ${{ matrix.version }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
version: ["stable", "nightly"]

steps:
- uses: actions/checkout@v2

- name: cache cargo artifacts
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
./target/debug
key: cargo-linux-${{ matrix.version }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
cargo-linux-${{ matrix.version }}-
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.version }}
override: true

- name: cargo check
uses: actions-rs/cargo@v1
timeout-minutes: 30
with:
command: check
args: --workspace --bins --examples --tests

- name: start redis
uses: supercharge/redis-github-action@1.1.0
with:
redis-version: 6

- name: cargo test
uses: actions-rs/cargo@v1
timeout-minutes: 30
env:
# included in example of redis, not clear its purpose
CI: true
with:
command: test
args: --workspace --all-features --no-fail-fast -- --nocapture
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
**/Cargo.lock
!/Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk
Expand Down
54 changes: 0 additions & 54 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit d836b04

Please sign in to comment.