-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (59 loc) · 1.72 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
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
services:
cassandra:
image: cassandra
ports:
- 9042:9042
# options: --health-cmd "cqlsh --debug" --health-interval 5s --health-retries 100
steps:
- name: Clone repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install Python
uses: actions/setup-python@v2
- name: Restore mtime
run: python ./git-restore-mtime.py
- name: protobuf install
run: |
sudo apt update -y
sudo apt-get install -y protobuf-compiler libprotobuf-dev
- name: Build
run: cargo build
- name: Prepare / Save test private key file from secrets
run: envsubst < private.key.envsubst.txt > private.key
env:
TEST_PRIVATE_SERVER_KEY: ${{ secrets.TEST_PRIVATE_SERVER_KEY }}
- name: Test / Save test cert file from secrets
run: envsubst < server.crt.envsubst.txt > server.crt
env:
TEST_SERVER_CERT: ${{ secrets.TEST_SERVER_CERT }}
- name: Test / Run lib unit tests
run: cargo test --lib -- --nocapture
- run: ls
- name: Test / Run new integration test (Go paho client)
working-directory: integration_test
run: go test -v