forked from solana-foundation/surfpool
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (58 loc) · 1.67 KB
/
rust.yml
File metadata and controls
62 lines (58 loc) · 1.67 KB
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
name: Rust
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
jobs:
license_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
with:
command: check licenses
run_cargo_checks:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libudev-dev
- uses: actions/checkout@v4
- name: Rust install nightly
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Rustup install clippy
run: rustup component add clippy
- name: Run Cargo fmt
run: cargo +nightly fmt --all -- --check
- name: Run Cargo clippy
run: cargo clippy --all-targets
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: surfpool
POSTGRES_PASSWORD: surfpool
POSTGRES_DB: surfpool_test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libudev-dev clang libclang-dev
- uses: actions/checkout@v4
- name: Build
run: cargo build --features postgres
- name: Run tests
env:
SURFPOOL_TEST_POSTGRES_URL: postgresql://surfpool:surfpool@localhost:5432/surfpool_test
run: cargo test --all --verbose --features "postgres,ignore_tests_ci"