Skip to content

Commit

Permalink
Add rustfmt and github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
G8XSU committed Apr 26, 2023
1 parent e909549 commit 01ab1e4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Continuous Integration Checks

on: [push, pull_request]

jobs:
build:
strategy:
matrix:
toolchain: [ stable, beta ]
include:
- toolchain: stable
check-fmt: true
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Install Rust ${{ matrix.toolchain }} toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
override: true
profile: minimal
- name: Build on Rust ${{ matrix.toolchain }}
run: cargo build --verbose --color always
- name: Check formatting
if: matrix.check-fmt
run: rustup component add rustfmt && cargo fmt --all -- --check
- name: Test on Rust ${{ matrix.toolchain }}
run: cargo test
5 changes: 5 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
hard_tabs = true # use tab characters for indentation, spaces for alignment
use_field_init_shorthand = true
max_width = 120
use_small_heuristics = "Max"
fn_args_layout = "Compressed"

0 comments on commit 01ab1e4

Please sign in to comment.