chore: Release relayport-rs version 0.1.1 #5
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: Rust | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:12 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
ports: | |
- 5432:5432 | |
mailhog: | |
image: mailhog/mailhog:v1.0.1 | |
ports: | |
- 1025:1025 | |
- 8025:8025 | |
redis: | |
image: redis:6 | |
ports: | |
- 6379:6379 | |
env: | |
SQLX_VERSION: 0.6.2 | |
SQLX_FEATURES: "rustls,postgres" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Cache dependencies | |
id: cache-dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Migrate database | |
run: | | |
echo sudo apt-get install libpq-dev -y | |
echo SKIP_DOCKER=true ./scripts/init_db.sh | |
- name: Run cargo test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
components: rustfmt | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
components: clippy | |
- uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: -- -D warnings | |
coverage: | |
name: Code coverage | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:12 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: password | |
ports: | |
- 5432:5432 | |
mailhog: | |
image: mailhog/mailhog:v1.0.1 | |
ports: | |
- 1025:1025 | |
- 8025:8025 | |
redis: | |
image: redis:7 | |
ports: | |
- 6379:6379 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Run cargo-tarpaulin | |
uses: actions-rs/[email protected] | |
with: | |
args: '--ignore-tests' | |
- name: Upload to codecov.io | |
uses: codecov/codecov-action@v3 | |
with: | |
token: f555d459-637e-412c-ab07-9c2045f30df7 | |
fail_ci_if_error: true | |