Skip to content

Add validation on payloads #50

Add validation on payloads

Add validation on payloads #50

Workflow file for this run

name: Rust
on:
push:
paths:
- "backend/**"
env:
CARGO_TERM_COLOR: always
jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Clippy
run: |
cd backend
cargo clippy -- -D warnings
api-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: password
POSTGRES_DB: crypto-issues
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: Install tarpaulin
run: cargo install cargo-tarpaulin
- name: Install diesel
run: cargo install diesel_cli --no-default-features -F postgres
- name: Run migrations
run: |
cd backend
diesel setup --database-url postgres://postgres:password@localhost:5432/crypto-issues
- name: Run tests
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/crypto-issues
GITHUB_KEY: ${{ secrets.GI_TOKEN }}
run: |
cd backend
cargo tarpaulin --out xml --skip-clean --fail-immediately
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
flags: backend