Skip to content

Commit

Permalink
Merge pull request #27 from Turbo87/ci
Browse files Browse the repository at this point in the history
Improve CI setup
  • Loading branch information
Turbo87 authored Nov 2, 2021
2 parents dbcf417 + 6a85c1c commit d543083
Showing 1 changed file with 36 additions and 23 deletions.
59 changes: 36 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,52 @@ name: CI

on:
push:
branches:
- master
- main
pull_request:

env:
# minimum supported rust version
MSRV: 1.46.0

jobs:
backend:
name: Backend
runs-on: ubuntu-18.04

env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0 -D warnings"

check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup override set ${{env.MSRV}}
- uses: Swatinem/rust-cache@v1.3.0
- run: cargo check --workspace --all-targets
env:
RUSTFLAGS: "-D warnings"

- name: Install Rust v${{ env.MSRV }}
run: |
rustup default ${{ env.MSRV }}
- name: Install lint tools
run: |
rustup component add rustfmt
rustup component add clippy
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup override set ${{env.MSRV}}
- uses: Swatinem/rust-cache@v1.3.0
- run: cargo test --workspace

- name: Lint
run: |
cargo fmt -- --check
cargo clippy --all-targets --all-features --all
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup override set ${{env.MSRV}}
- run: rustup component add rustfmt
- uses: Swatinem/rust-cache@v1.3.0
- run: cargo fmt --all -- --check

- name: Test
run: cargo test
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup override set ${{env.MSRV}}
- run: rustup component add clippy
- uses: Swatinem/rust-cache@v1.3.0
- run: cargo clippy --workspace -- --deny warnings

0 comments on commit d543083

Please sign in to comment.