Skip to content

Tower

Tower #299

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request: {}
jobs:
check:
# Run `cargo check` first to ensure that the pushed code at least compiles.
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.60.0, stable]
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
- name: Check
uses: actions-rs/cargo@v1
with:
command: check
args: --all --bins --tests --benches
test:
needs: check
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.60.0, stable, beta]
redis-version: [6]
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
# Starts Redis server needed by hitbox-redis for integration tests.
- name: Start Redis
uses: supercharge/redis-github-action@1.4.0
with:
redis-version: ${{ matrix.redis-version }}
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --all-features -- --test-threads=1
- name: Generate coverage file
if: >
matrix.rust == 'stable'
run: |
cargo install cargo-tarpaulin
cargo tarpaulin --out Xml --verbose --workspace --all-features --ignore-tests -- --test-threads=1
- name: Upload to Codecov
if: >
matrix.rust == 'stable'
uses: codecov/codecov-action@v3
with:
file: cobertura.xml
clippy:
# Check for any warnings. This is informational and thus is allowed to fail.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
profile: minimal
- name: Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --workspace --all-features --bins --examples --tests --benches -- -D warnings