Use our RocksDB fork with patch for checkpoints (#41) #181
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
pull_request: | |
push: | |
# `staging` and `trying` are required for bors | |
branches: [master, staging, trying] | |
env: | |
# Just a reassurance to mitigate sudden network connection problems | |
CARGO_NET_RETRY: 50 | |
RUSTUP_MAX_RETRIES: 50 | |
CARGO_INCREMENTAL: 0 | |
RUST_BACKTRACE: full | |
CARGO_REGISTRIES_ELASTIO_PRIVATE_TOKEN: ${{ secrets.CLOUDSMITH_API_TOKEN }} | |
# We don't need any debug symbols on ci, this also speeds up builds a bunch | |
RUSTFLAGS: --deny warnings -Cdebuginfo=0 | |
RUSTDOCFLAGS: --deny warnings | |
concurrency: | |
cancel-in-progress: true | |
group: "ci-${{ github.workflow }}-${{ github.ref }}" | |
jobs: | |
cargo-deny-check: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
checks: | |
- advisories | |
- bans licenses sources | |
# Prevent sudden announcement of a new advisory from failing ci: | |
continue-on-error: ${{ matrix.checks == 'advisories' }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Read rust-toolchain file | |
id: rust-toolchain | |
run: | | |
echo "RUST_TOOLCHAIN=$(cat rust-toolchain)" >> $GITHUB_ENV | |
- uses: elastio/actions/rust-toolchain@v1 | |
with: | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
components: rustfmt, clippy | |
- uses: EmbarkStudios/cargo-deny-action@v1 | |
with: | |
credentials: https://token:${{ secrets.PRIVATE_REGISTRY_TOKEN }}@dl.cloudsmith.io | |
command: check ${{ matrix.checks }} | |
rust-lint: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# Note: Windows builds don't work currently because `clang` isn't | |
# installed so `bindgen` fails | |
# | |
# We dont' care about RocksDB on Windows anyway so i didn't bother | |
# trying to get it working | |
os: [macos-latest, ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Read rust-toolchain file | |
id: rust-toolchain | |
run: | | |
echo "RUST_TOOLCHAIN=$(cat rust-toolchain)" >> $GITHUB_ENV | |
- uses: elastio/actions/rust-toolchain@v1 | |
with: | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
components: rustfmt, clippy | |
# io_uring needs this to compile properly | |
- run: sudo apt-get install -y linux-headers-$(uname -r) | |
if: matrix.os == 'ubuntu-latest' | |
- run: git config --global credential.helper store && echo https://token:${{ secrets.PRIVATE_REGISTRY_TOKEN }}@dl.cloudsmith.io > $HOME/.git-credentials | |
- run: cargo fmt --all -- --check | |
- run: cargo doc --workspace --no-deps | |
- run: cargo clippy --workspace --all-targets --all-features | |
rust-test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# Note: Windows builds don't work currently because `clang` isn't | |
# installed so `bindgen` fails | |
# | |
# We dont' care about RocksDB on Windows anyway so i didn't bother | |
# trying to get it working | |
# | |
# On macOS there was some duplicate symbol error from the linker for | |
# `crc32c_runtime_check` which, again, I didn't bother to run down | |
# because we don't care about Rocks on macOS | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Read rust-toolchain file | |
id: rust-toolchain | |
run: | | |
echo "RUST_TOOLCHAIN=$(cat rust-toolchain)" >> $GITHUB_ENV | |
- uses: elastio/actions/rust-toolchain@v1 | |
with: | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
components: rustfmt, clippy | |
# set up dependencies so that the async version with io_uring support can build | |
# This may not be all deps that are required to get async support compiling. I gave up on it but | |
# to get as far as I did required tehse additional packages | |
- run: sudo apt-get install -y libboost-all-dev g++ openssl libssl-dev libunwind-dev libgoogle-glog-dev linux-headers-$(uname -r) | |
- run: git config --global credential.helper store && echo https://token:${{ secrets.PRIVATE_REGISTRY_TOKEN }}@dl.cloudsmith.io > $HOME/.git-credentials | |
- run: cargo test --workspace --no-run | |
- run: cargo test --workspace | |
- run: cargo test --workspace --all-features | |
rust-code-coverage: | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: '-C instrument-coverage' | |
LLVM_PROFILE_FILE: "${{ github.workspace }}/coverage-%p-%m.profraw" | |
RUSTC_BOOTSTRAP: 1 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
- run: git config --global credential.helper store && echo https://token:${{ secrets.PRIVATE_REGISTRY_TOKEN }}@dl.cloudsmith.io > $HOME/.git-credentials | |
- run: sudo apt-get install -y linux-headers-$(uname -r) | |
- run: cargo test --workspace --all-targets --all-features | |
- name: Install grcov | |
run: | | |
rustup component add llvm-tools-preview | |
curl -L https://github.com/mozilla/grcov/releases/download/v0.8.2/grcov-linux-x86_64.tar.bz2 | tar jxf - | |
- name: Run grcov | |
run: | | |
# The `--ignore /*` exclues from coverage analysis anything in a cargo crate (meaning includes only this repo) | |
# | |
# without that the `lcov.info` file will be 10s of MB and the shitty Node.js Coveralls importer will eat shit and die | |
./grcov . --binary-path ./target/debug/ -t lcov -s . -o ./lcov.info --branch --ignore-not-existing --ignore "/*" | |
# These commands help with debugging if coveralls ingest is failing | |
file lcov.info | |
du -h lcov.info | |
head --bytes 10240 lcov.info | |
cat lcov.info | grep SF: || echo No source file information | |
- name: Upload code coverage info | |
uses: coverallsapp/[email protected] | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: "${{ github.workspace }}/lcov.info" |