rustdesk 3 years ago
parent
commit
cd1a9885db
1 changed files with 69 additions and 0 deletions
  1. 69 0
      .github/workflows/test.yml

+ 69 - 0
.github/workflows/test.yml

@@ -0,0 +1,69 @@
1
+name: test
2
+
3
+on:
4
+  push:
5
+    branches: [ "master" ]
6
+  pull_request:
7
+    branches: [ "master" ]
8
+
9
+jobs:
10
+  check:
11
+    runs-on: ubuntu-latest
12
+    steps:
13
+      - uses: actions/checkout@v3
14
+      - uses: actions-rs/toolchain@v1
15
+        with:
16
+          profile: minimal
17
+          toolchain: nightly
18
+          override: true
19
+      - uses: Swatinem/rust-cache@v2
20
+      - uses: actions-rs/cargo@v1
21
+        with:
22
+          command: check
23
+
24
+  test:
25
+    runs-on: ubuntu-latest
26
+    steps:
27
+      - uses: actions/checkout@v3
28
+      - uses: actions-rs/toolchain@v1
29
+        with:
30
+          profile: minimal
31
+          toolchain: nightly
32
+          override: true
33
+      - uses: Swatinem/rust-cache@v2
34
+      - uses: actions-rs/cargo@v1
35
+        with:
36
+          command: test
37
+          args: --all
38
+
39
+  fmt:
40
+    runs-on: ubuntu-latest
41
+    steps:
42
+      - uses: actions/checkout@v3
43
+      - uses: actions-rs/toolchain@v1
44
+        with:
45
+          profile: minimal
46
+          toolchain: nightly
47
+          override: true
48
+          components: rustfmt
49
+      - uses: Swatinem/rust-cache@v2
50
+      - uses: actions-rs/cargo@v1
51
+        with:
52
+          command: fmt
53
+          args: --all -- --check
54
+
55
+  clippy:
56
+    runs-on: ubuntu-latest
57
+    steps:
58
+      - uses: actions/checkout@v3
59
+      - uses: actions-rs/toolchain@v1
60
+        with:
61
+          profile: minimal
62
+          toolchain: nightly
63
+          override: true
64
+          components: clippy
65
+      - uses: Swatinem/rust-cache@v2
66
+      - uses: actions-rs/cargo@v1
67
+        with:
68
+          command: clippy
69
+          args: --all -- -D warnings