Merge pull request #191 from foundationdb-rs/189-fix-coverage-ci #8
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: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
simulation: | |
name: "Simulation framework" | |
runs-on: ubuntu-latest | |
steps: | |
- name: disk space | |
run: df -h / | |
- name: Maximize build space | |
uses: easimon/maximize-build-space@master | |
with: | |
remove-dotnet: 'true' | |
remove-android: 'true' | |
remove-haskell: 'true' | |
overprovision-lvm: 'true' | |
- name: disk space | |
run: df -h / | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: docker build | |
run: docker build -t simulation . -f foundationdb-simulation/examples/atomic/Dockerfile | |
- name: docker run | |
run: docker run --rm simulation | |
compatibility: | |
name: "Compat ${{ matrix.os }}/${{ matrix.toolchain }}/${{ matrix.fdb_feature_version }}" | |
strategy: | |
matrix: | |
os: ["ubuntu-latest", "macos-13"] | |
toolchain: ["1.71.1", "stable"] | |
fdb_feature_version: ["fdb-7_3", "fdb-7_1", "fdb-7_0", "fdb-6_3", "fdb-6_2", "fdb-6_1"] | |
runs-on: ${{ matrix.os }} | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUST_BACKTRACE: 1 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup FoundationDB | |
uses: foundationdb-rs/[email protected] | |
with: | |
version: "7.3.27" | |
- name: Enable tenant | |
run: fdbcli --exec "configure single memory tenant_mode=optional_experimental" | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.toolchain }} | |
- name: Build | |
run: cargo build --verbose -p foundationdb --no-default-features --features ${{ matrix.fdb_feature_version }} | |
- name: Test | |
# Examples needs to have uuid enabled | |
run: cargo test --verbose -p foundationdb --no-default-features --features ${{ matrix.fdb_feature_version }},uuid | |
test: | |
name: "Test foundationDB with ${{ matrix.toolchain }}" | |
strategy: | |
matrix: | |
toolchain: ["1.71.1", "stable", "beta", "nightly"] | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install FoundationDB | |
uses: foundationdb-rs/[email protected] | |
with: | |
version: "7.3.27" | |
- name: Enable tenant | |
run: fdbcli --exec "configure single memory tenant_mode=optional_experimental" | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: "${{ matrix.toolchain }}" | |
components: rustfmt, clippy | |
- name: Run all tests | |
run: cargo test -p foundationdb --features num-bigint,embedded-fdb-include,tenant-experimental,fdb-7_3 | |
lint: | |
name: Rustfmt / Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install FoundationDB | |
uses: foundationdb-rs/[email protected] | |
with: | |
version: "7.3.27" | |
- name: Enable tenant | |
run: fdbcli --exec "configure single memory tenant_mode=optional_experimental" | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
components: rustfmt, clippy | |
- name: Fmt | |
run: cargo fmt --all -- --check | |
- name: Clippy | |
run: cargo clippy --features num-bigint,embedded-fdb-include,tenant-experimental,fdb-7_3 --no-default-features | |
audit: | |
name: Cargo audit | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install FoundationDB | |
uses: foundationdb-rs/[email protected] | |
with: | |
version: "7.1.37" | |
- uses: rustsec/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} |