Skip to content

Setup GitHub Actions #4

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

Merged
merged 1 commit into from
Sep 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: CI

on:
schedule:
- cron: '0 0 * * 6'
push:
branches:
- '*'
pull_request:

jobs:
rustfmt:
strategy:
fail-fast: false
matrix:
toolchain:
- 1.42.0-x86_64-unknown-linux-gnu
- stable-x86_64-unknown-linux-gnu

name: Rustfmt (${{ matrix.toolchain }})
runs-on: ubuntu-18.04

steps:
- name: Checkout
uses: actions/checkout@v2

- name: 'Setup `${{ matrix.toolchain }}`'
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
profile: minimal
components: rustfmt

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

build:
strategy:
fail-fast: false
matrix:
toolchain:
- 1.42.0-x86_64-pc-windows-msvc
- 1.42.0-x86_64-apple-darwin
- 1.42.0-x86_64-unknown-linux-gnu
- stable-x86_64-pc-windows-msvc
- stable-x86_64-apple-darwin
- stable-x86_64-unknown-linux-gnu
include:
- { toolchain: 1.42.0-x86_64-pc-windows-msvc , os: windows-2019 }
- { toolchain: 1.42.0-x86_64-apple-darwin , os: macos-10.15 }
- { toolchain: 1.42.0-x86_64-unknown-linux-gnu, os: ubuntu-18.04 }
- { toolchain: stable-x86_64-pc-windows-msvc , os: windows-2019 }
- { toolchain: stable-x86_64-apple-darwin , os: macos-10.15 }
- { toolchain: stable-x86_64-unknown-linux-gnu, os: ubuntu-18.04 }

name: Build (${{ matrix.toolchain }})
runs-on: ${{ matrix.os }}

steps:
- name: Disable `core.autocrlf`
run: git config --global core.autocrlf false
if: matrix.os == 'windows-2019'

- name: Checkout
uses: actions/checkout@v2

- name: 'Setup `${{ matrix.toolchain }}`'
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
profile: minimal
components: clippy

- name: cargo-clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-targets -- -D warnings

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

- name: cargo-test
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --no-fail-fast
env:
RUST_BACKTRACE: full