Update docker image #49
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: | |
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: nightly | |
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: nightly | |
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 | |