diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9a0bf13 --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..6f3fe3c --- /dev/null +++ b/rustfmt.toml @@ -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" \ No newline at end of file