-
Notifications
You must be signed in to change notification settings - Fork 21
42 lines (37 loc) · 1000 Bytes
/
rust-test.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
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get update && \
sudo apt-get install -y --no-install-recommends \
libkrb5-dev \
libssl-dev
- name: Install a Postgres database (CockroachDB)
run: |
git clone https://github.com/cockroachlabs-field/docker-examples.git
cd docker-examples/example-nginx/
sh up.sh
- name: Build
run: cargo build --verbose
- name: Clippy
run: cargo clippy -- -Dwarnings
- name: Run tests
run: |
# Env var to connect to the Postgres docker
export POSTGRES_HOST="localhost"
export POSTGRES_PORT="26257"
export POSTGRES_USER="root"
export POSTGRES_PASSWORD=""
export POSTGRES_DBNAME="test"
cargo test --verbose