forked from tonarino/innernet
-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (70 loc) · 1.98 KB
/
rust.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
name: Rust
on:
push:
branches:
- '*'
jobs:
test:
runs-on: [self-hosted,"${{ matrix.os }}"]
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
steps:
- uses: actions/checkout@v4
- name: get channel
run: |
echo "channel=$(cat rust-toolchain.toml | grep channel | awk '{print $3}' | sed 's/"//g')" >> "$GITHUB_ENV"
- name: set cargo env
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.channel }}
- name: Install Dependencies (if Ubuntu)
env:
ACCEPT_EULA: Y
run: sudo apt-get -y update && sudo apt-get install -f && sudo apt-get -y install libsqlite3-dev libclang-11-dev
if: contains(runner.os, 'Linux')
- uses: Swatinem/rust-cache@v1
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose
- name: Test (IPv6)
uses: actions-rs/cargo@v1
with:
command: test
args: --features v6-test --verbose
fmt:
runs-on: [self-hosted,"${{ matrix.os }}"]
steps:
- uses: actions/checkout@v4
- name: get channel
run: |
echo "channel=$(cat rust-toolchain.toml | grep channel | awk '{print $3}' | sed 's/"//g')" >> "$GITHUB_ENV"
- name: set cargo env
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.channel }}
- name: Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
runs-on: [self-hosted,"${{ matrix.os }}"]
steps:
- uses: actions/checkout@v4
- name: get channel
run: |
echo "channel=$(cat rust-toolchain.toml | grep channel | awk '{print $3}' | sed 's/"//g')" >> "$GITHUB_ENV"
- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets -- -D warnings