-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (75 loc) · 2.22 KB
/
test.yml
File metadata and controls
91 lines (75 loc) · 2.22 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
name: Test worfklow
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# This is needed if we are using github enterprise.
permissions:
contents: write
pull-requests: write
id-token: write
on:
push:
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
check:
strategy:
matrix:
os: [ubuntu-22.04]
runs-on: [self-hosted, "${{ matrix.os }}", baremetal]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set cargo
uses: dtolnay/rust-toolchain@1.79.0
- name: Clear rust cache
run: |
cargo cache -r all
- name: Set build cargo cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
fumarole/${{ matrix.os }}
key: ${{ matrix.os }}_fumarole_${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.os }}_fumarole
- name: Cargo fmt
if: startsWith(github.ref, 'refs/tags/') != true
run: cargo +nightly fmt --all -- --check
- name: Cargo clippy
if: startsWith(github.ref, 'refs/tags/') != true
run: cargo clippy --workspace --all-targets --tests
- name: Cargo deny check advisories
if: startsWith(github.ref, 'refs/tags/') != true
uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check advisories
- name: Cargo check the entire project
if: startsWith(github.ref, 'refs/tags/') != true
run: cargo check --all-targets --tests --all-features
- name: Set PROTOC environment variable in order to build
run: echo "PROTOC=/usr/bin/protoc" >> $GITHUB_ENV
test:
needs: check
runs-on: ubuntu-22.04
services:
etcd:
image: bitnami/etcd:3.5
ports:
- 2379:2379
- 2380:2380
env:
ALLOW_NONE_AUTHENTICATION: 'yes'
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set cargo
uses: dtolnay/rust-toolchain@1.79.0
- name: Run tests
run: cargo test --test -- --nocapture