Skip to content

Commit e551c7b

Browse files
committedDec 21, 2020
.github: Add dependabot and CI workflows
1 parent 9ae99d2 commit e551c7b

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed
 

‎.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "cargo"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"

‎.github/workflows/rust.yml

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
on: [push, pull_request]
2+
3+
name: Continuous integration
4+
5+
jobs:
6+
check:
7+
name: Check
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: actions-rs/toolchain@v1
12+
with:
13+
profile: minimal
14+
toolchain: stable
15+
override: true
16+
17+
# Caching
18+
- name: Cache cargo registry
19+
uses: actions/cache@v1
20+
with:
21+
path: ~/.cargo/registry
22+
key: cargo-registry-${{ hashFiles('Cargo.toml') }}
23+
- name: Cache cargo index
24+
uses: actions/cache@v1
25+
with:
26+
path: ~/.cargo/git
27+
key: cargo-index-${{ hashFiles('Cargo.toml') }}
28+
29+
- uses: actions-rs/cargo@v1
30+
with:
31+
command: check
32+
33+
test:
34+
name: Test Suite
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v2
38+
- uses: actions-rs/toolchain@v1
39+
with:
40+
profile: minimal
41+
toolchain: stable
42+
override: true
43+
44+
# Caching
45+
- name: Cache cargo registry
46+
uses: actions/cache@v1
47+
with:
48+
path: ~/.cargo/registry
49+
key: cargo-registry-${{ hashFiles('Cargo.toml') }}
50+
- name: Cache cargo index
51+
uses: actions/cache@v1
52+
with:
53+
path: ~/.cargo/git
54+
key: cargo-index-${{ hashFiles('Cargo.toml') }}
55+
56+
- uses: actions-rs/cargo@v1
57+
with:
58+
command: test
59+
60+
fmt:
61+
name: Rustfmt
62+
runs-on: ubuntu-latest
63+
steps:
64+
- uses: actions/checkout@v2
65+
- uses: actions-rs/toolchain@v1
66+
with:
67+
profile: minimal
68+
toolchain: stable
69+
override: true
70+
- run: rustup component add rustfmt
71+
- uses: actions-rs/cargo@v1
72+
with:
73+
command: fmt
74+
args: --all -- --check
75+
76+
clippy:
77+
name: Clippy
78+
runs-on: ubuntu-latest
79+
continue-on-error: true
80+
steps:
81+
- uses: actions/checkout@v2
82+
- uses: actions-rs/toolchain@v1
83+
with:
84+
profile: minimal
85+
toolchain: stable
86+
override: true
87+
- run: rustup component add clippy
88+
89+
# Caching
90+
- name: Cache cargo registry
91+
uses: actions/cache@v1
92+
with:
93+
path: ~/.cargo/registry
94+
key: cargo-registry-${{ hashFiles('Cargo.toml') }}
95+
- name: Cache cargo index
96+
uses: actions/cache@v1
97+
with:
98+
path: ~/.cargo/git
99+
key: cargo-index-${{ hashFiles('Cargo.toml') }}
100+
101+
- uses: actions-rs/cargo@v1
102+
continue-on-error: true
103+
with:
104+
command: clippy
105+
args: -- -D warnings

0 commit comments

Comments
 (0)
Please sign in to comment.