Skip to content

Commit f66c748

Browse files
committed
Add rustfmt and github ci
1 parent e909549 commit f66c748

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

.github/workflows/build.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Continuous Integration Checks
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
toolchain: [ stable, beta ]
10+
include:
11+
- toolchain: stable
12+
check-fmt: true
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout source code
16+
uses: actions/checkout@v2
17+
- name: Install Rust ${{ matrix.toolchain }} toolchain
18+
uses: actions-rs/toolchain@v1
19+
with:
20+
toolchain: ${{ matrix.toolchain }}
21+
override: true
22+
profile: minimal
23+
- name: Build on Rust ${{ matrix.toolchain }}
24+
run: cargo build --verbose --color always
25+
- name: Check formatting
26+
if: matrix.check-fmt
27+
run: rustup component add rustfmt && cargo fmt --all -- --check
28+
- name: Test on Rust ${{ matrix.toolchain }}
29+
run: cargo test

rustfmt.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
hard_tabs = true # use tab characters for indentation, spaces for alignment
2+
use_field_init_shorthand = true
3+
max_width = 120
4+
use_small_heuristics = "Max"
5+
fn_args_layout = "Compressed"

0 commit comments

Comments
 (0)