sero/.github/workflows/test.yml
Dmitry Miasnenko 782d8e4b05
Update readme. Remove openapi.json and adjust workflows. (#26)
* readme-fix: remove warning about cli tool. Update version in docker-compose.yml to match.

* Updated readme.md. Fully remove openapi.json. Remove version cmp beteen Cargo.toml and openapi.json. Added openapi.josn to gitignore.
2024-10-04 15:59:59 +03:00

90 lines
1.8 KiB
YAML

name: "Test"
on:
pull_request:
push:
branches:
- "**" # matches every branch
jobs:
check:
name: "Run cargo check"
runs-on: "ubuntu-latest"
steps:
- name: "Check out the repo"
uses: actions/checkout@v3
- uses: "actions-rs/toolchain@v1"
with:
profile: "minimal"
toolchain: "stable"
override: true
- uses: "actions-rs/cargo@v1"
with:
command: "check"
tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Run tests (with database service)
run: cargo test --verbose -- --test-threads=1
fmt:
name: "Run cargo fmt"
runs-on: "ubuntu-latest"
steps:
- name: "Check out the repo"
uses: actions/checkout@v3
- uses: "actions-rs/toolchain@v1"
with:
profile: "minimal"
toolchain: "nightly"
override: true
- run: "rustup component add rustfmt"
- uses: "actions-rs/cargo@v1"
with:
command: "fmt"
args: "--all -- --check"
clippy:
name: "Run cargo clippy"
runs-on: "ubuntu-latest"
steps:
- name: "Check out the repo"
uses: actions/checkout@v3
- uses: "actions-rs/toolchain@v1"
with:
profile: "minimal"
toolchain: "stable"
override: true
- run: "rustup component add clippy"
- uses: "actions-rs/cargo@v1"
with:
command: "clippy"
args: "-- -D warnings"