Skip to content

Commit

Permalink
add GitHub action for push and pr
Browse files Browse the repository at this point in the history
  • Loading branch information
rizsotto committed May 2, 2020
1 parent faafba1 commit 573cc5b
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: continuous integration

on: [push, pull_request]

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, windows-2019, macOS-latest]
rust: [stable, nightly]

steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Build
uses: actions-rs/cargo@v1
# Force to build without warnings
env:
RUSTFLAGS: '-D warnings'
with:
command: build
args: --verbose
- name: Run tests
uses: actions-rs/cargo@v1
# force to build tests without warnings
env:
RUSTFLAGS: '-D warnings'
with:
command: test
args: --verbose

rustfmt_check:

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Ensure that rustfmt is installed
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt
- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy_check:

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Ensure that clippy is installed
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: clippy
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-targets --all-features

0 comments on commit 573cc5b

Please sign in to comment.