-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (62 loc) · 1.74 KB
/
rust.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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