Skip to content

fix(api): return proper error for server list instead of silently #21

fix(api): return proper error for server list instead of silently

fix(api): return proper error for server list instead of silently #21

Workflow file for this run

name: Rust
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
name: Test & Build
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: nmcscan
POSTGRES_PASSWORD: nmcscan_secret
POSTGRES_DB: nmcscan_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: ". -> target"
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Check formatting
run: cargo fmt --all -- --check
- name: Clippy (warnings as errors)
run: cargo clippy -- -D warnings
- name: Run tests
run: cargo test --verbose
- name: Build release
run: cargo build --release --verbose
- name: Verify binary
run: |
file target/release/nmcscan
target/release/nmcscan --help
docker:
name: Docker Build
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: nmcscan:latest
cache-from: type=gha
cache-to: type=gha,mode=max