name: Build
on: [push,pull_request]
jobs:
build-and-test:
services:
cassandra:
image: cassandra:3.11.12
ports:
- 9042:9042
strategy:
matrix:
include:
- name: Ubuntu 20.04 - Release
runner: ubuntu-20.04
cargo_flags: --release
- name: Ubuntu 22.04 - Release
runner: ubuntu-22.04
cargo_flags: --release
- name: Ubuntu 20.04 - Debug
runner: ubuntu-20.04
cargo_flags:
- name: Ubuntu 22.04 - Debug
runner: ubuntu-22.04
cargo_flags:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: |
DCO_SIGNING_BASE_COMMIT=f43fa8aeac397cfbd4a470f506581948e807013c
git log ${DCO_SIGNING_BASE_COMMIT}.. --grep "^signed-off-by: .\+@.\+" --regexp-ignore-case --invert-grep --no-merges --pretty=oneline > tmp-unsigned-dco
if [ -s tmp-unsigned-dco ] ; then
echo '**One or more commits are not signed off! Unsigned commits:'
cat tmp-unsigned-dco
echo '**Please sign these commits and amend your PR.'
/bin/false
fi
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: cache custom ubuntu packages
uses: actions/cache@v3
with:
path: scripts/packages
key: ubuntu-packages-${{ matrix.runner }}
- run: scripts/install_ubuntu_packages.sh
- run: cargo clippy --all-targets -- -A clippy::float_cmp
- run: cargo fmt --all --check
- run: cargo build --all ${{ matrix.cargo_flags }}
- run: cargo test ${{ matrix.cargo_flags }} -- --test-threads 1