Skip to content

Commit

Permalink
CI: Add GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
teohhanhui committed Oct 10, 2023
1 parent 1af3316 commit 0674825
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 1 deletion.
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI

on:
push:
branches:
- main
pull_request:

env:
CARGO_INCREMENTAL: '0'
RUST_BACKTRACE: short
RUSTFLAGS: -Dwarnings

jobs:
clippy:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [stable, beta, nightly]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: 'clippy'
- name: Run Clippy
run: cargo clippy --all-targets --all-features

test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [stable, beta, nightly]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Run tests
run: cargo test --no-fail-fast

rustdoc:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, beta, nightly]
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: 'rust-docs'
- name: Run Rustdoc
run: cargo doc --no-deps --all-features

rustfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: 'rustfmt'
- name: Run Rustfmt
run: cargo fmt --check
2 changes: 1 addition & 1 deletion crates/automerge_orm/src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl<T: ?Sized> Ord for Key<T> {

impl<T: ?Sized> PartialOrd for Key<T> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.0.partial_cmp(&other.0)
Some(self.cmp(other))
}
}

Expand Down

0 comments on commit 0674825

Please sign in to comment.