-
Notifications
You must be signed in to change notification settings - Fork 20
118 lines (86 loc) · 2.86 KB
/
main.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Main Workflow
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
SURREALDB_VERSION: v1.1.1
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Download SurrealDB
run: curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh -s -- --version $SURREALDB_VERSION
- name: Run SurrealDB root
run: surreal start --user root --pass root memory &
- name: Run SurrealDB admin
run: surreal start --user admin --pass admin --bind 0.0.0.0:8001 memory &
- name: Run check
run: cargo check --all
- name: Run tests
run: cargo test
- name: Run format
run: |
cargo check --all
cargo fix
- name: Run lint
run: cargo clippy -- -Dwarnings
coverage:
needs: ci
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Download SurrealDB
run: curl --proto '=https' --tlsv1.2 -sSf https://install.surrealdb.com | sh -s -- --version $SURREALDB_VERSION
- name: Run SurrealDB root
run: surreal start --user root --pass root memory &
- name: Run SurrealDB admin
run: surreal start --user admin --pass admin --bind 0.0.0.0:8001 memory &
- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
version: "0.22.0"
args: "--engine llvm --target-dir target/tarpaulin --skip-clean"
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
- name: Archive code coverage results
uses: actions/upload-artifact@v1
with:
name: code-coverage-report
path: cobertura.xml
docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Build documentation
run: cargo doc
cargo-deny:
name: cargo-deny
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- advisories
- bans licenses sources
# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: ${{ matrix.checks == 'advisories' }}
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check ${{ matrix.checks }}