on e98cdeb help sign in
129 lines 3.5 kB history raw
1# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
2#
3# While our "example" application has the platform-specific code,
4# for simplicity we are compiling and testing everything on the Ubuntu environment only.
5# For multi-OS testing see the `cross.yml` workflow.
7on: [push, pull_request]
9name: Build
11jobs:
12 check:
13 name: Check
14 runs-on: ubuntu-latest
15 steps:
16 - name: Checkout sources
17 uses: actions/checkout@v2
19 - name: Install stable toolchain
20 uses: actions-rs/toolchain@v1
21 with:
22 profile: minimal
23 toolchain: stable
24 override: true
26 - name: Cache cargo registry
27 uses: actions/cache@v1
28 with:
29 path: ~/.cargo/registry
30 key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
32 - name: Cache cargo index
33 uses: actions/cache@v1
34 with:
35 path: ~/.cargo/git
36 key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
38 - name: Cache cargo target dir
39 uses: actions/cache@v1
40 with:
41 path: target
42 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
44 - name: Run cargo check
45 uses: actions-rs/cargo@v1
46 with:
47 command: check
49 test:
50 name: Test Suite
51 runs-on: ubuntu-latest
52 steps:
53 - name: Checkout sources
54 uses: actions/checkout@v2
56 - name: Install stable toolchain
57 uses: actions-rs/toolchain@v1
58 with:
59 profile: minimal
60 toolchain: stable
61 override: true
63 - name: Cache cargo registry
64 uses: actions/cache@v1
65 with:
66 path: ~/.cargo/registry
67 key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
69 - name: Cache cargo index
70 uses: actions/cache@v1
71 with:
72 path: ~/.cargo/git
73 key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
75 - name: Cache cargo target dir
76 uses: actions/cache@v1
77 with:
78 path: target
79 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
81 - name: Run cargo test
82 uses: actions-rs/cargo@v1
83 with:
84 command: test
86 lints:
87 name: Lints
88 runs-on: ubuntu-latest
89 steps:
90 - name: Checkout sources
91 uses: actions/checkout@v2
93 - name: Install stable toolchain
94 uses: actions-rs/toolchain@v1
95 with:
96 profile: minimal
97 toolchain: stable
98 override: true
99 components: rustfmt, clippy
101 - name: Cache cargo registry
102 uses: actions/cache@v1
103 with:
104 path: ~/.cargo/registry
105 key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
107 - name: Cache cargo index
108 uses: actions/cache@v1
109 with:
110 path: ~/.cargo/git
111 key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
113 - name: Cache cargo target dir
114 uses: actions/cache@v1
115 with:
116 path: target
117 key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
119 - name: Run cargo fmt
120 uses: actions-rs/cargo@v1
121 with:
122 command: fmt
123 args: --all -- --check
125 - name: Run cargo clippy
126 uses: actions-rs/cargo@v1
127 with:
128 command: clippy
129 args: -- -D warnings