-
Notifications
You must be signed in to change notification settings - Fork 10
111 lines (95 loc) · 2.63 KB
/
ci.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
name: CI
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
# Disable previous runs
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
# ${{ vars.CI_UNIFIED_IMAGE }} is defined in the repository variables
jobs:
check:
name: "check"
runs-on: ubuntu-latest
container:
image: ${{ vars.CI_IMAGE }}
steps:
- uses: actions/checkout@v3
# uncomment if needed
# - name: fmt
# run: |
# cargo fmt --all --check
- name: Rust Cache
uses: Swatinem/rust-cache@v2.5.0
with:
cache-on-failure: true
cache-all-crates: true
- name: check
run: cargo check
test:
name: "test"
runs-on: ubuntu-latest
timeout-minutes: 20
container:
image: ${{ vars.CI_IMAGE }}
# options: --privileged
options: --sysctl net.ipv6.conf.all.disable_ipv6=0
steps:
- uses: actions/checkout@v3
# - name: Install Rust stable toolchain
# uses: actions-rs/toolchain@v1.0.7
# with:
# profile: minimal
# toolchain: 1.75.0
# override: true
- name: Rust Cache
uses: Swatinem/rust-cache@v2.5.0
with:
cache-on-failure: true
cache-all-crates: true
- name: test
run: |
# sudo apt-get update && sudo apt-get install -y iproute2 protobuf-compiler
echo "Installing iproute2..."
apt-get update && apt-get install -y iproute2 iputils-ping
# ip a
# echo "Enabling loopback interface explicitly..."
# ip link set lo up
echo "Result"
ip a
ping -c 1 127.0.0.1
echo "Starting a simple HTTP server..."
python3 -m http.server --bind 127.0.0.1 8080 &
sleep 1
curl 127.0.0.1:8080
echo "Running tests..."
cargo test
doc:
name: "doc"
runs-on: ubuntu-latest
container:
image: ${{ vars.CI_IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Rust Cache
uses: Swatinem/rust-cache@v2.5.0
with:
cache-on-failure: true
cache-all-crates: true
- name: doc
run: cargo doc
clippy:
name: "clippy"
runs-on: ubuntu-latest
container:
image: ${{ vars.CI_IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Rust Cache
uses: Swatinem/rust-cache@v2.5.0
with:
cache-on-failure: true
cache-all-crates: true
- name: clippy
continue-on-error: true
run: cargo clippy