-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (100 loc) · 2.87 KB
/
validation.yaml
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
---
on:
push:
branches:
- main
pull_request:
name: Rust Validation
env:
RUSTDOCFLAGS: -D warnings
RUSTFLAGS: -C debuginfo=1
RUST_LOG: debug
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
jobs:
check:
name: "Check (cargo clippy)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/[email protected]
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-features --all-targets -- -D warnings
env:
TEST_TANG_URL: '' # just for validation
- run: cargo clippy --no-default-features --all-targets -- -D warnings
test:
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: "Test on ${{ matrix.os }} (cargo test)"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: dtolnay/[email protected]
- uses: Swatinem/rust-cache@v2
- run: cargo test
integration:
name: "Integration testing (docker)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Start docker
# the port used is "tang" in ascii, easy to remember
run: >
docker run --rm -d
-v $(pwd)/tang-db:/db
-e ENABLE_IPv6=1
-p 11697:8080
--name tang-backend
padhihomelab/tang
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run integration testing
env:
TEST_TANG_URL: localhost:11697
# Run only integration tests with `--test '*'`
run: cargo test --test '*' --features _backend
- name: Print docker logs
if: always()
run: |
docker logs tang-backend
# If any critical / debug options were printed, error out
docker logs tang-backend 2>&1 | grep -iE '\[(Critical|Error)\]' || exit 0 && exit 1;
docker stop tang-backend
fmt:
name: "Format (cargo fmt)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --all -- --check
doc:
name: "Docs (cargo doc)"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- run: cargo doc
outdated:
name: Outdated
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- uses: dtolnay/install@cargo-outdated
- uses: Swatinem/rust-cache@v2
- run: cargo outdated --workspace --exit-code 1
security_audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: rustsec/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}