-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.5 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Tests
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
unit:
name: Tests
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-C target-cpu=native" # Required by Gxhash requires aes and sse2 intrinsics
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Install cargo components
run: |
rustup component add rustfmt
rustup component add clippy
- name: Install apt dependencies
run: |
sudo apt-get update
sudo apt-get -y --no-install-recommends install nginx build-essential cmake libsnappy-dev libleveldb-dev libpcre3-dev
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Build and test
run: |
cargo build --verbose --all
cargo test --verbose --all
- name: Run cargo clippy
run: |
cargo clippy --all-targets --all -- --deny=warnings
- name: Set log permissions
run: |
sudo mkdir -p /var/log/nginx
sudo chmod 777 /var/log/nginx /var/log/nginx/*
- name: Install Python Requirements
run: pip3 install --no-cache-dir -r requirements.txt
- name: Set execute permissions for test script
run: chmod +x ./tools/test.py && chmod +x ./tools/bringup.sh
- name: Integration Test
run: |
(./tools/bringup-test.sh &)
./tools/test.py