Skip to content

Commit

Permalink
CI: use GitHub Action (#90)
Browse files Browse the repository at this point in the history
Use GitHub Action instead of Travis CI to reduce the total time CI takes
  • Loading branch information
Fullstop000 authored Nov 4, 2020
1 parent e93d9d1 commit 4808826
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 63 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
on:
push:
branches:
- master
pull_request:
branches:
- master

name: Test

jobs:
run-test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.ignore-err }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
toolchain: [stable]
ignore-err: [false]
coverage: [false]
include:
- os: ubuntu-latest
toolchain: nightly
ignore-err: true
coverage: true
- os: macos-latest
toolchain: nightly
ignore-err: true
coverage: false
steps:
- uses: actions/checkout@v2
name: Checkout 🛎️
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-test
- uses: actions-rs/toolchain@v1
name: Setup Cargo Toolchain 🛎️
with:
components: rustfmt, clippy
toolchain: ${{ matrix.toolchain }}
override: true
default: true
- uses: actions-rs/cargo@v1
name: Check Code Format 🔧
with:
command: fmt
args: -- --check
- uses: actions-rs/cargo@v1
name: Run Cargo Clippy 🔧
with:
command: clippy
args: -- -D warnings
- uses: actions-rs/cargo@v1
name: Running Tests 🚀
with:
command: test
args: --all
- uses: actions-rs/cargo@v1
name: Cargo Clean
if: ${{ matrix.coverage }}
with:
command: clean
- uses: actions-rs/cargo@v1
name: Tests with coverage reports 🚀
if: ${{ matrix.coverage }}
with:
command: test
args: --all-features --no-fail-fast
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
- id: coverage
if: ${{ matrix.coverage }}
uses: actions-rs/[email protected]
- name: Coveralls upload 📕
if: ${{ matrix.coverage }}
uses: codecov/codecov-action@v1
with:
file: ${{ steps.coverage.outputs.report }}
55 changes: 0 additions & 55 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ impl<S: Storage + Clone + 'static, C: Comparator + 'static> DBImpl<S, C> {
}

// Recover in the order in which the logs were generated
logs_to_recover.sort();
logs_to_recover.sort_unstable();
let mut max_sequence = 0;
let mut edit = VersionEdit::new(self.options.max_levels);
for (i, log_number) in logs_to_recover.iter().enumerate() {
Expand Down
5 changes: 1 addition & 4 deletions src/mem/skiplist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,7 @@ impl<C: Comparator, A: Arena> Skiplist<C, A> {
true
} else {
let node_key = unsafe { (*n).key() };
match self.comparator.compare(key, node_key) {
CmpOrdering::Greater => false,
_ => true,
}
!matches!(self.comparator.compare(key, node_key), CmpOrdering::Greater)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/version/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub struct Version<C: Comparator> {

impl<C: Comparator> fmt::Debug for Version<C> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "vnum: {} \n", &self.vnum)?;
writeln!(f, "vnum: {} ", &self.vnum)?;
for (level, files) in self.files.iter().enumerate() {
write!(f, "level {}: [ ", level)?;
for file in files {
Expand All @@ -101,7 +101,7 @@ impl<C: Comparator> fmt::Debug for Version<C> {
file.number, file.file_size, file.smallest, file.largest
)?;
}
write!(f, " ]\n")?;
writeln!(f, " ]")?;
}
Ok(())
}
Expand Down Expand Up @@ -251,7 +251,7 @@ impl<C: Comparator + 'static> Version<C> {
acc
});
s.push_str(summary.as_str());
s.push_str("]");
s.push(']');
s
}

Expand Down

0 comments on commit 4808826

Please sign in to comment.